[lttng-dev] [PATCH lttng-tools] Fix: Memory leaks on error paths when exporting consumerd libdir in env

Christian Babeux christian.babeux at efficios.com
Thu Feb 28 15:48:26 EST 2013


Signed-off-by: Christian Babeux <christian.babeux at efficios.com>
---
 src/bin/lttng-sessiond/main.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/bin/lttng-sessiond/main.c b/src/bin/lttng-sessiond/main.c
index e9529f1..82f0a84 100644
--- a/src/bin/lttng-sessiond/main.c
+++ b/src/bin/lttng-sessiond/main.c
@@ -1798,6 +1798,7 @@ static pid_t spawn_consumerd(struct consumer_data *consumer_data)
 				ret = putenv(tmpnew);
 				if (ret) {
 					ret = -errno;
+					free(tmpnew);
 					goto error;
 				}
 			}
@@ -1842,6 +1843,7 @@ static pid_t spawn_consumerd(struct consumer_data *consumer_data)
 				ret = putenv(tmpnew);
 				if (ret) {
 					ret = -errno;
+					free(tmpnew);
 					goto error;
 				}
 			}
-- 
1.8.1.3




More information about the lttng-dev mailing list