From: Jérémie Galarneau Date: Wed, 18 Sep 2019 17:47:26 +0000 (-0400) Subject: Fix: release reference to trace chunk on index file creation failure X-Git-Tag: v2.11.0-rc4~23 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=92e415922d60df808cf61a851f16649b2e1542b5;p=lttng-tools.git Fix: release reference to trace chunk on index file creation failure The reference to a trace chunk that is acquired in _lttng_index_file_create_from_trace_chunk() is leaked on error. Release the reference in the function's error path. Signed-off-by: Jérémie Galarneau --- diff --git a/src/common/index/index.c b/src/common/index/index.c index 7c73dcfbd..b2e36211a 100644 --- a/src/common/index/index.c +++ b/src/common/index/index.c @@ -151,6 +151,7 @@ error: PERROR("Failed to close file descriptor of index file"); } } + lttng_trace_chunk_put(chunk); free(index_file); return NULL; }