Fix: path value retrieval memory leak
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Mon, 5 Sep 2016 19:47:29 +0000 (15:47 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Sat, 27 May 2017 18:09:06 +0000 (14:09 -0400)
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
plugins/ctf/fs/fs.c

index 6c7f2030b994a01c0a73a2b643916971c11b68b1..adc1b30d105c7cb278aea0b0097b164c0d3b3d65 100644 (file)
@@ -131,7 +131,7 @@ static
 struct ctf_fs_component *ctf_fs_create(struct bt_value *params)
 {
        struct ctf_fs_component *ctf_fs;
-       struct bt_value *value;
+       struct bt_value *value = NULL;
        const char *path;
        enum bt_value_status ret;
 
@@ -161,10 +161,12 @@ struct ctf_fs_component *ctf_fs_create(struct bt_value *params)
        ctf_fs_data_stream_init(ctf_fs, &ctf_fs->data_stream);
        ctf_fs_metadata_set_trace(ctf_fs);
        ctf_fs_data_stream_open_streams(ctf_fs);
-end:
-       return ctf_fs;
+       goto end;
+
 error:
        ctf_fs_destroy_data(ctf_fs);
+end:
+       BT_PUT(value);
        return ctf_fs;
 }
 
This page took 0.026333 seconds and 4 git commands to generate.