From 8318bbaae63a9b00bcc3d9bf66a6d73ecd34f7ed Mon Sep 17 00:00:00 2001 From: Philippe Proulx Date: Fri, 5 May 2017 16:46:41 -0400 Subject: [PATCH] ctf.fs source: metadata: fix error paths MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Philippe Proulx Signed-off-by: Jérémie Galarneau --- plugins/ctf/common/metadata/decoder.c | 1 + plugins/ctf/fs-src/metadata.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/plugins/ctf/common/metadata/decoder.c b/plugins/ctf/common/metadata/decoder.c index 81d6ddef..a36a0860 100644 --- a/plugins/ctf/common/metadata/decoder.c +++ b/plugins/ctf/common/metadata/decoder.c @@ -248,6 +248,7 @@ error: if (*buf) { free(*buf); + *buf = NULL; } end: diff --git a/plugins/ctf/fs-src/metadata.c b/plugins/ctf/fs-src/metadata.c index cd211961..13cc816e 100644 --- a/plugins/ctf/fs-src/metadata.c +++ b/plugins/ctf/fs-src/metadata.c @@ -109,6 +109,7 @@ int ctf_fs_metadata_set_trace(struct ctf_fs_component *ctf_fs) file = get_file(ctf_fs, ctf_fs->trace_path->str); if (!file) { PERR("Cannot create metadata file object\n"); + ret = -1; goto end; } @@ -117,6 +118,7 @@ int ctf_fs_metadata_set_trace(struct ctf_fs_component *ctf_fs) ctf_fs->options.clock_offset_ns); if (!metadata_decoder) { PERR("Cannot create metadata decoder object\n"); + ret = -1; goto end; } -- 2.34.1