Fix: kernel metadata data leak in error path
authorDavid Goulet <dgoulet@efficios.com>
Tue, 14 May 2013 16:11:03 +0000 (12:11 -0400)
committerDavid Goulet <dgoulet@efficios.com>
Tue, 14 May 2013 16:11:18 +0000 (12:11 -0400)
Issue 1019922 of coverity scan.

Signed-off-by: David Goulet <dgoulet@efficios.com>
src/bin/lttng-sessiond/kernel.c

index 856d4231004b02c558ea32f7cc86a7e315734331..2c6d1e8c335c887118711acafaeccf488bdd8cba 100644 (file)
@@ -353,7 +353,7 @@ error:
 int kernel_open_metadata(struct ltt_kernel_session *session)
 {
        int ret;
-       struct ltt_kernel_metadata *lkm;
+       struct ltt_kernel_metadata *lkm = NULL;
 
        assert(session);
 
@@ -366,7 +366,7 @@ int kernel_open_metadata(struct ltt_kernel_session *session)
        /* Kernel tracer metadata creation */
        ret = kernctl_open_metadata(session->fd, &lkm->conf->attr);
        if (ret < 0) {
-               goto error;
+               goto error_open;
        }
 
        lkm->fd = ret;
@@ -382,6 +382,8 @@ int kernel_open_metadata(struct ltt_kernel_session *session)
 
        return 0;
 
+error_open:
+       trace_kernel_destroy_metadata(lkm);
 error:
        return -1;
 }
This page took 0.026542 seconds and 4 git commands to generate.