From 1ef09eb5014a506f82104a01fb89f9bd58a14c28 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Mon, 5 Sep 2016 15:47:29 -0400 Subject: [PATCH] Fix: path value retrieval memory leak MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérémie Galarneau --- plugins/ctf/fs/fs.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/plugins/ctf/fs/fs.c b/plugins/ctf/fs/fs.c index 6c7f2030..adc1b30d 100644 --- a/plugins/ctf/fs/fs.c +++ b/plugins/ctf/fs/fs.c @@ -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; } -- 2.34.1