From: David Goulet Date: Tue, 25 Jun 2013 14:55:21 +0000 (-0400) Subject: Fix: kernel memory leak in error path X-Git-Tag: v2.2.0~12 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=5f62c6859033b2c8189dc6144b4ba099e3f108aa;p=lttng-tools.git Fix: kernel memory leak in error path Signed-off-by: David Goulet --- diff --git a/src/bin/lttng-sessiond/kernel.c b/src/bin/lttng-sessiond/kernel.c index 2c6d1e8c3..064fdc382 100644 --- a/src/bin/lttng-sessiond/kernel.c +++ b/src/bin/lttng-sessiond/kernel.c @@ -110,6 +110,9 @@ int kernel_create_session(struct ltt_session *session, int tracer_fd) return 0; error: + if (lks) { + trace_kernel_destroy_session(lks); + } return ret; } @@ -163,6 +166,10 @@ int kernel_create_channel(struct ltt_kernel_session *session, return 0; error: + if (lkc) { + free(lkc->channel); + free(lkc); + } return -1; }