From: Simon Marchi Date: Thu, 7 Dec 2023 20:00:11 +0000 (+0000) Subject: src.ctf.lttng-live: use GCharUP in lttng_live_component_create X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=commitdiff_plain;h=6838d8aa4659141864f1479ff1641769ce1b0da5 src.ctf.lttng-live: use GCharUP in lttng_live_component_create Change-Id: Ieffb41481d6696c46fd51483414a59fae1099ede Signed-off-by: Simon Marchi Reviewed-on: https://review.lttng.org/c/babeltrace/+/8451 Reviewed-by: Philippe Proulx Reviewed-on: https://review.lttng.org/c/babeltrace/+/12366 Tested-by: jenkins --- diff --git a/src/plugins/ctf/lttng-live/lttng-live.cpp b/src/plugins/ctf/lttng-live/lttng-live.cpp index 0c446862..d3f2c22d 100644 --- a/src/plugins/ctf/lttng-live/lttng-live.cpp +++ b/src/plugins/ctf/lttng-live/lttng-live.cpp @@ -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; }