From: Simon Marchi Date: Tue, 5 Dec 2023 05:12:00 +0000 (+0000) Subject: src.ctf.fs: use GStringUP in ctf_fs_component_create_ctf_fs_trace_one_path X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=commitdiff_plain;h=c8ca3c11efd73512470281d4f0af213dab23fd5f src.ctf.fs: use GStringUP in ctf_fs_component_create_ctf_fs_trace_one_path Change-Id: I6405c80bdfc519fe45ebadadcfd2e396da9a74cb Signed-off-by: Simon Marchi Reviewed-on: https://review.lttng.org/c/babeltrace/+/8289 Reviewed-by: Philippe Proulx Reviewed-on: https://review.lttng.org/c/babeltrace/+/12326 Tested-by: jenkins --- diff --git a/src/plugins/ctf/fs-src/fs.cpp b/src/plugins/ctf/fs-src/fs.cpp index 7f0de79b..0fbe96bc 100644 --- a/src/plugins/ctf/fs-src/fs.cpp +++ b/src/plugins/ctf/fs-src/fs.cpp @@ -802,9 +802,8 @@ static int ctf_fs_component_create_ctf_fs_trace_one_path(struct ctf_fs_component { ctf_fs_trace::UP ctf_fs_trace; int ret; - GString *norm_path; - norm_path = bt_common_normalize_path(path_param, NULL); + bt2c::GStringUP norm_path {bt_common_normalize_path(path_param, NULL)}; if (!norm_path) { BT_CPPLOGE_APPEND_CAUSE_SPEC(ctf_fs->logger, "Failed to normalize path: `{}`.", path_param); goto error; @@ -846,10 +845,6 @@ error: ret = -1; end: - if (norm_path) { - g_string_free(norm_path, TRUE); - } - return ret; }