Fix: kernel memory leak in error path
authorDavid Goulet <dgoulet@efficios.com>
Tue, 25 Jun 2013 14:55:21 +0000 (10:55 -0400)
committerDavid Goulet <dgoulet@efficios.com>
Tue, 25 Jun 2013 14:55:21 +0000 (10:55 -0400)
Signed-off-by: David Goulet <dgoulet@efficios.com>
src/bin/lttng-sessiond/kernel.c

index 2c6d1e8c335c887118711acafaeccf488bdd8cba..064fdc382026e19eef78c132310153a5e863863f 100644 (file)
@@ -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;
 }
 
This page took 0.026237 seconds and 4 git commands to generate.