Fix: stream fd leaks on error
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 15 Dec 2020 14:01:38 +0000 (09:01 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 24 Feb 2021 15:17:05 +0000 (10:17 -0500)
commit9369ec329b164bd0772d6835149683180940b814
treeb25b9ccc2a740545b2133cecc4dcaab440ed0ae5
parentd147c5c868813a4d2e42777b574f7a2c94e3a092
Fix: stream fd leaks on error

Use a regular pattern for all commands:

If the command callback takes ownership of a pointer or file descriptor,
it sets them to NULL or -1. Therefore, the caller can always try to free
the pointer, or close it if it is greater or equal to 0.

This eliminates memory and fd leaks on error.

Change-Id: I447129ab1672ce4fc6cf3c0baf18dbf27bfcfaf8
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
liblttng-ust/lttng-ust-abi.c
liblttng-ust/lttng-ust-comm.c
This page took 0.024548 seconds and 4 git commands to generate.