Fix: Memory leaks on error paths in config_read_session_name
authorChristian Babeux <christian.babeux@efficios.com>
Thu, 28 Feb 2013 20:48:25 +0000 (15:48 -0500)
committerDavid Goulet <dgoulet@efficios.com>
Thu, 21 Mar 2013 17:14:42 +0000 (13:14 -0400)
Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
src/bin/lttng/conf.c

index c1bfcfd45b8d87eacfae6d3be878033121ee85cc..7439c1cdcf4d0fac711f7a5f4acfbd018a83a773 100644 (file)
@@ -203,6 +203,7 @@ char *config_read_session_name(char *path)
        if (fp == NULL) {
                ERR("Can't find valid lttng config %s/.lttngrc", path);
                MSG("Did you create a session? (lttng create <my_session>)");
+               free(session_name);
                goto error;
        }
 
@@ -221,6 +222,7 @@ char *config_read_session_name(char *path)
        }
 
 error_close:
+       free(session_name);
        ret = fclose(fp);
        if (ret < 0) {
                PERROR("close config read session name");
This page took 0.024594 seconds and 4 git commands to generate.