From: Jérémie Galarneau Date: Mon, 9 Sep 2019 14:46:21 +0000 (-0400) Subject: Fix: return NULL on trace chunk registry failure X-Git-Tag: v2.12.0-rc1~429 X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=commitdiff_plain;h=8243bf1242a85b68217f36784948ed752c9b7325;ds=sidebyside Fix: return NULL on trace chunk registry failure A free'd registry object can be returned in the error paths of lttng_trace_chunk_registry_create(). Right now, this happens whenever the allocation of the registry's hash table fails. Signed-off-by: Jérémie Galarneau --- diff --git a/src/common/trace-chunk.c b/src/common/trace-chunk.c index fe244ac36..9f0919a88 100644 --- a/src/common/trace-chunk.c +++ b/src/common/trace-chunk.c @@ -1096,7 +1096,7 @@ end: return registry; error: lttng_trace_chunk_registry_destroy(registry); - goto end; + return NULL; } LTTNG_HIDDEN