From: Christian Babeux Date: Thu, 28 Feb 2013 20:48:25 +0000 (-0500) Subject: Fix: Memory leaks on error paths in config_read_session_name X-Git-Tag: v2.2.0-rc1~53 X-Git-Url: http://git.lttng.org/?a=commitdiff_plain;h=dcee6f19f636b7443cc70dd27911630c4da476fa;p=lttng-tools.git Fix: Memory leaks on error paths in config_read_session_name Signed-off-by: Christian Babeux Signed-off-by: David Goulet --- diff --git a/src/bin/lttng/conf.c b/src/bin/lttng/conf.c index c1bfcfd45..7439c1cdc 100644 --- a/src/bin/lttng/conf.c +++ b/src/bin/lttng/conf.c @@ -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 )"); + 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");