From: Mathieu Desnoyers Date: Wed, 2 Aug 2017 15:34:43 +0000 (-0400) Subject: Fix: uninitialized return value on error path X-Git-Tag: v2.8.8~1 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=b0c07e45528c4ba3c306c780261a9d54bacd94e6;p=lttng-tools.git Fix: uninitialized return value on error path Found by Coverity: *** CID 1378810: Uninitialized variables (UNINIT) /src/bin/lttng-sessiond/context.c: 73 in add_kctx_all_channels() Signed-off-by: Mathieu Desnoyers Signed-off-by: Jérémie Galarneau --- diff --git a/src/bin/lttng-sessiond/context.c b/src/bin/lttng-sessiond/context.c index a2f022886..1e68bd8bb 100644 --- a/src/bin/lttng-sessiond/context.c +++ b/src/bin/lttng-sessiond/context.c @@ -55,6 +55,7 @@ static int add_kctx_all_channels(struct ltt_kernel_session *ksession, kctx_copy = trace_kernel_copy_context(kctx); if (!kctx_copy) { PERROR("zmalloc ltt_kernel_context"); + ret = -ENOMEM; goto error; }