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)
commit46c7e45bc65331d6b43ffc44c7c30265d0a03480
tree0a06c00d991d605174ffcdcb15b0ba1dc0cc0643
parent10265ebe457aa6633556c604e27e865e66d14f0b
Fix: lib: fix memory leak in simple_sink_init error path

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>
src/lib/graph/component-class-sink-simple.c
This page took 0.023993 seconds and 4 git commands to generate.