Fix: Memory leak when zmalloc fail on kernel channel allocation
[lttng-tools.git] / src / bin / lttng-sessiond / trace-kernel.c
index 990684be918db721a36b8265813b4d8bdcb38cb7..6a17776aa4fc10a8337c1aa9ea3383515d9f480a 100644 (file)
@@ -158,6 +158,7 @@ struct ltt_kernel_channel *trace_kernel_create_channel(
        lkc->channel = zmalloc(sizeof(struct lttng_channel));
        if (lkc->channel == NULL) {
                PERROR("lttng_channel zmalloc");
+               free(lkc);
                goto error;
        }
        memcpy(lkc->channel, chan, sizeof(struct lttng_channel));
This page took 0.023778 seconds and 4 git commands to generate.