Fix: lib: fix memory leak in simple_sink_init error path
authorSimon Marchi <simon.marchi@efficios.com>
Mon, 31 Jan 2022 17:33:17 +0000 (12:33 -0500)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Wed, 16 Feb 2022 19:16:46 +0000 (14:16 -0500)
If bt_self_component_sink_add_input_port fails, we don't free the
simple_sink_data instance.

Move the code to free a simple_sink_data in a new function,
simple_sink_data_destroy.  Call it from simple_sink_finalize and from
simple_sink_init's error path.

Change-Id: If8f87ef4a39836e02ed1c125dc8feb160d21cc37
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/7196
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Tested-by: jenkins <jenkins@lttng.org>

No differences found
This page took 0.025183 seconds and 4 git commands to generate.