Fix: Memory leak when zmalloc fail on kernel channel allocation
authorChristian Babeux <christian.babeux@efficios.com>
Thu, 28 Feb 2013 20:48:29 +0000 (15:48 -0500)
committerDavid Goulet <dgoulet@efficios.com>
Thu, 21 Mar 2013 17:16:03 +0000 (13:16 -0400)
Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
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.025159 seconds and 4 git commands to generate.