From: Jérémie Galarneau Date: Mon, 5 Sep 2016 19:47:29 +0000 (-0400) Subject: Fix: path value retrieval memory leak X-Git-Tag: v2.0.0-pre1~772 X-Git-Url: http://git.efficios.com/?a=commitdiff_plain;h=1ef09eb5014a506f82104a01fb89f9bd58a14c28;hp=413bc2c417a706e7e2cc331077421e89e36daea0;p=babeltrace.git Fix: path value retrieval memory leak Signed-off-by: Jérémie Galarneau --- 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; }