Fix: src.ctf.fs: trace-info: port_name memory leak
authorFrancis Deslauriers <francis.deslauriers@efficios.com>
Wed, 12 Jun 2019 20:32:46 +0000 (16:32 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Fri, 5 Jul 2019 18:36:18 +0000 (14:36 -0400)
Valgrind report:
  ==21704== 256 bytes in 4 blocks are definitely lost in loss record 29 of 38
  ==21704==    at 0x4C31D2F: realloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
  ==21704==    by 0x555EA1F: g_realloc (gmem.c:164)
  ==21704==    by 0x557AF56: g_string_maybe_expand (gstring.c:102)
  ==21704==    by 0x557B2E4: g_string_insert_len (gstring.c:476)
  ==21704==    by 0x557B44C: g_string_assign (gstring.c:349)
  ==21704==    by 0x6B2D8C5: ctf_fs_make_port_name (fs.c:427)
  ==21704==    by 0x6B31FCD: populate_stream_info (query.c:342)
  ==21704==    by 0x6B321E9: populate_trace_info (query.c:417)
  ==21704==    by 0x6B32592: trace_info_query (query.c:525)
  ==21704==    by 0x6B3104C: ctf_fs_query (fs.c:2326)
  ==21704==    by 0x4E7ED6A: bt_query_executor_query (query-executor.c:128)
  ==21704==    by 0x10DCDA: query (babeltrace2.c:201)

Reported-by: Valgrind Memcheck
Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Change-Id: I4e8ac593327d170005fd984ef7744656e7feb47d
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1419
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
src/plugins/ctf/fs-src/query.c

index 6cfe5b4f7bcdcc20cfdcf04df3d7f56f65bf0fd0..1ba84b4a8393200f566cf70b79f92b28722c0da2 100644 (file)
@@ -357,6 +357,9 @@ int populate_stream_info(struct ctf_fs_ds_file_group *group,
        }
 
 end:
+       if (port_name) {
+               g_free(port_name);
+       }
        bt_value_put_ref(file_paths);
        return ret;
 }
This page took 0.034469 seconds and 4 git commands to generate.