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.12.0-rc1~370 X-Git-Url: http://git.liburcu.org/?p=lttng-tools.git;a=commitdiff_plain;h=307db950d03f305b6b705e5316e4a7571197144f 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; }