Fix: uninitialized return value on error path
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 2 Aug 2017 15:34:43 +0000 (11:34 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 2 Aug 2017 16:49:58 +0000 (12:49 -0400)
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 <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-sessiond/context.c

index a2f022886306ccb55e9c72a4751d896d6c3f9ae2..1e68bd8bb9ff2b9090146da82c36e8c90104a4c5 100644 (file)
@@ -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");
                kctx_copy = trace_kernel_copy_context(kctx);
                if (!kctx_copy) {
                        PERROR("zmalloc ltt_kernel_context");
+                       ret = -ENOMEM;
                        goto error;
                }
 
                        goto error;
                }
 
This page took 0.026279 seconds and 4 git commands to generate.