Fix: memory leak in load session thread
authorDavid Goulet <dgoulet@efficios.com>
Mon, 22 Sep 2014 15:05:06 +0000 (11:05 -0400)
committerDavid Goulet <dgoulet@efficios.com>
Mon, 22 Sep 2014 15:05:06 +0000 (11:05 -0400)
Fixes Coverity issue 1213789.

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

index 38fa1f616104175c2f31fd56807764a3a36b3b37..868d7c55279b25e2455f626408cdf9118ffbdfd4 100644 (file)
@@ -51,7 +51,7 @@ void load_session_destroy_data(struct load_session_thread_data *data)
 int load_session_init_data(struct load_session_thread_data **data)
 {
        int ret;
-       struct load_session_thread_data *_data;
+       struct load_session_thread_data *_data = NULL;
 
        assert(data);
 
@@ -75,6 +75,7 @@ int load_session_init_data(struct load_session_thread_data **data)
        return 0;
 
 error:
+       free(_data);
        return -1;
 }
 
This page took 0.034326 seconds and 4 git commands to generate.