From: Christian Babeux Date: Thu, 28 Feb 2013 20:48:26 +0000 (-0500) Subject: Fix: Memory leaks on error paths when exporting consumerd libdir in env X-Git-Tag: v2.2.0-rc1~52 X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=commitdiff_plain;h=c6f76da97bc9ed51b9f37adf046dd4b35b0db753 Fix: Memory leaks on error paths when exporting consumerd libdir in env Signed-off-by: Christian Babeux Signed-off-by: David Goulet --- diff --git a/src/bin/lttng-sessiond/main.c b/src/bin/lttng-sessiond/main.c index f57a5c911..d88bafeb6 100644 --- a/src/bin/lttng-sessiond/main.c +++ b/src/bin/lttng-sessiond/main.c @@ -1885,6 +1885,7 @@ static pid_t spawn_consumerd(struct consumer_data *consumer_data) ret = putenv(tmpnew); if (ret) { ret = -errno; + free(tmpnew); goto error; } } @@ -1929,6 +1930,7 @@ static pid_t spawn_consumerd(struct consumer_data *consumer_data) ret = putenv(tmpnew); if (ret) { ret = -errno; + free(tmpnew); goto error; } }