src.ctf.fs: use GStringUP in ctf_fs_component_create_ctf_fs_trace_one_path
authorSimon Marchi <simon.marchi@efficios.com>
Tue, 5 Dec 2023 05:12:00 +0000 (05:12 +0000)
committerSimon Marchi <simon.marchi@efficios.com>
Wed, 17 Apr 2024 17:57:53 +0000 (13:57 -0400)
Change-Id: I6405c80bdfc519fe45ebadadcfd2e396da9a74cb
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8289
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12326
Tested-by: jenkins <jenkins@lttng.org>
src/plugins/ctf/fs-src/fs.cpp

index 7f0de79bac0b643e82b5fc4505d3ba31d323687e..0fbe96bc122f31a4c06745f875b2e4ed864d814e 100644 (file)
@@ -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;
 }
 
This page took 0.025928 seconds and 4 git commands to generate.