Fix: channel leak on error
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 15 Dec 2020 13:48:59 +0000 (08:48 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 24 Feb 2021 15:15:29 +0000 (10:15 -0500)
commit24e6ac9b18904de64d31dc79f53b1c8296541c8a
treed1386a1b3784738837cea7bd0737d8027f0660a0
parent01a9d8837a56844c01bc1f97a7daedd7902efc2e
Fix: channel leak 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: I0f9cba5fc0f4c095c8ec8f3e8970de8a10386876
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.024795 seconds and 5 git commands to generate.