src.ctf.lttng-live: use GCharUP in lttng_live_component_create
authorSimon Marchi <simon.marchi@efficios.com>
Tue, 26 Jul 2022 21:35:47 +0000 (17:35 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Tue, 23 Aug 2022 16:06:16 +0000 (12:06 -0400)
Change-Id: Ieffb41481d6696c46fd51483414a59fae1099ede
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8451
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
src/plugins/ctf/lttng-live/lttng-live.cpp

index cfc962cac7d1aef14a75f158f532cbc5ebce3353..3b710ff32f20d3fc415dd6510b19264fab6e2f86 100644 (file)
@@ -22,6 +22,7 @@
 #include "compat/compiler.h"
 #include <babeltrace2/types.h>
 #include "cpp-common/exc.hpp"
+#include "cpp-common/glib-up.hpp"
 
 #include "plugins/common/muxing/muxing.h"
 #include "plugins/common/param-validation/param-validation.h"
@@ -2069,6 +2070,7 @@ lttng_live_component_create(const bt_value *params, bt_self_component *self_comp
         status = BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_MEMORY_ERROR;
         goto error;
     } else if (validation_status == BT_PARAM_VALIDATION_STATUS_VALIDATION_ERROR) {
+        bt2_common::GCharUP errorFreer {validation_error};
         BT_CLOGE_APPEND_CAUSE("%s", validation_error);
         status = BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_ERROR;
         goto error;
@@ -2102,8 +2104,6 @@ error:
     delete lttng_live;
     lttng_live = NULL;
 end:
-    g_free(validation_error);
-
     *component = lttng_live;
     return status;
 }
This page took 0.024879 seconds and 5 git commands to generate.