cli: clear current thread's error, if any, before exiting
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Thu, 4 Jul 2019 05:58:46 +0000 (01:58 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Sat, 6 Jul 2019 03:47:50 +0000 (23:47 -0400)
Because the CLI is not consuming the current thread's error yet, clear
it every time to avoid a memory leak.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: Ifb36292a20a5592e660ce16201ee13e017d01780
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1614
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Reviewed-by: Simon Marchi <simon.marchi@efficios.com>
src/cli/babeltrace2.c

index e5d4370ccf6365c0c1e8452324dae77c5eebd5d0..78d7b9b62f553db42933f40e2cb48e3e2b0ce271 100644 (file)
@@ -2866,5 +2866,11 @@ int main(int argc, const char **argv)
 end:
        BT_OBJECT_PUT_REF_AND_RESET(cfg);
        fini_static_data();
+
+       /*
+        * Clear current thread's error in case there is one to avoid a
+        * memory leak.
+        */
+       bt_current_thread_clear_error();
        return retcode;
 }
This page took 0.025129 seconds and 4 git commands to generate.