src.ctf.lttng-live: use GCharUP in lttng_live_component_create
authorSimon Marchi <simon.marchi@efficios.com>
Thu, 7 Dec 2023 20:00:11 +0000 (20:00 +0000)
committerSimon Marchi <simon.marchi@efficios.com>
Wed, 17 Apr 2024 17:57:53 +0000 (13:57 -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>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12366
Tested-by: jenkins <jenkins@lttng.org>
src/plugins/ctf/lttng-live/lttng-live.cpp

index 0c446862c14f4560f79b1f6c99145dd746537c4c..d3f2c22d1e6f368707f41d64f03453e0bb9eb2cf 100644 (file)
@@ -13,6 +13,7 @@
 
 #include "common/assert.h"
 #include "cpp-common/bt2c/fmt.hpp"
+#include "cpp-common/bt2c/glib-up.hpp"
 #include "cpp-common/vendor/fmt/format.h"
 
 #include "plugins/common/muxing/muxing.h"
@@ -2028,6 +2029,7 @@ lttng_live_component_create(const bt_value *params, bt_self_component_source *se
         status = BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_MEMORY_ERROR;
         goto error;
     } else if (validation_status == BT_PARAM_VALIDATION_STATUS_VALIDATION_ERROR) {
+        bt2c::GCharUP errorFreer {validation_error};
         BT_CPPLOGE_APPEND_CAUSE_SPEC(logger, "{}", validation_error);
         status = BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_ERROR;
         goto error;
@@ -2059,8 +2061,6 @@ error:
     delete lttng_live;
     lttng_live = NULL;
 end:
-    g_free(validation_error);
-
     *component = lttng_live;
     return status;
 }
This page took 0.024953 seconds and 4 git commands to generate.