Fix: memory and fd leaks in error counter
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 15 Dec 2020 14:30:53 +0000 (09:30 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 24 Feb 2021 15:14:42 +0000 (10:14 -0500)
commitd61ad9ef7bc9a9650ae9e2793ff7e3afe816a670
tree7c32500b3961d03f3bb67780e0e1be3f82170b13
parentab89263ef2f50399e608e74557900aa0a3165a61
Fix: memory and fd leaks in error counter

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: I4916920095526c166636c6a432b95fdd6fd1ca4b
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
liblttng-ust/lttng-ust-comm.c
This page took 0.023994 seconds and 4 git commands to generate.