Skip to contentSkip to conversation

Fix: uninitialized return value on error path

PATCH Jérémie Galarneau 1 participant 1 message Aug 3, 2017 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

Merged in master, stable-2.10, stable-2.9 and stable-2.8.

Thanks!
Jérémie

Quoted 25 lines · Mathieu Desnoyers

Found by Coverity:

*** CID 1378810: Uninitialized variables (UNINIT) /src/bin/lttng-sessiond/context.c: 73 in add_kctx_all_channels()

---
 src/bin/lttng-sessiond/context.c | 1 +
 1 file changed, 1 insertion(+)
src/bin/lttng-sessiond/context.c +1 -1
index a2f02288..1e68bd8b 100644
@@ -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;
                }
 
--

2.11.0

Signature · 7 lines
Jérémie Galarneau
EfficiOS Inc.
http://www.efficios.com
_______________________________________________
lttng-dev mailing list
[email protected]
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev