Fix: flt.lttng-utils.debug-info: possible leak of `bt_message` on error
authorFrancis Deslauriers <francis.deslauriers@efficios.com>
Sat, 13 Jul 2019 12:46:11 +0000 (08:46 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Sat, 13 Jul 2019 14:45:03 +0000 (10:45 -0400)
Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Change-Id: I8587be191edcc644c0a8b9a9c9d6198fb308bb2d
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1703
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
src/plugins/lttng-utils/debug-info/debug-info.c

index 75e1a6fe2b0381ebd5fb8c6903482ff9c58d6da4..75eb0175321d307341e198e059f87310eafa4ac1 100644 (file)
@@ -1913,6 +1913,14 @@ handle_msg_error:
                bt_message_put_ref(msgs[i]);
        }
 
+       /*
+        * Drop references of all the input messages not dropped before the
+        * failure.
+        */
+       for (i = curr_msg_idx; i < *count; i++) {
+               bt_message_put_ref(input_msgs[i]);
+       }
+
        status = BT_COMPONENT_CLASS_MESSAGE_ITERATOR_NEXT_METHOD_STATUS_MEMORY_ERROR;
 
 end:
This page took 0.027711 seconds and 4 git commands to generate.