From: Mathieu Desnoyers Date: Tue, 15 Dec 2020 14:14:09 +0000 (-0500) Subject: Fix: event notifier group: fix fd leak on error X-Git-Tag: v2.13.0-rc1~393 X-Git-Url: https://git.lttng.org/?a=commitdiff_plain;h=f52e590232f939bd6b5c88a483765c03e37fc733;hp=f52e590232f939bd6b5c88a483765c03e37fc733;p=lttng-ust.git Fix: event notifier group: fix fd 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: If5181a0c438f2e1ac73e5d4d63d5cde21cc97e52 Signed-off-by: Mathieu Desnoyers ---