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.11.0-rc4~82 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=4e42a5ac4102053ced991911a781be77959ddf55;p=lttng-tools.git 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