[lttng-dev] [PATCH lttng-tools] Fix: Use after free on spawn_sessiond error path in check_sessiond

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


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

diff --git a/src/bin/lttng/lttng.c b/src/bin/lttng/lttng.c
index 8562144..be673f9 100644
--- a/src/bin/lttng/lttng.c
+++ b/src/bin/lttng/lttng.c
@@ -374,13 +374,12 @@ static int check_sessiond(void)
 		}
 
 		ret = spawn_sessiond(pathname);
-		free(alloc_pathname);
 		if (ret < 0) {
 			ERR("Problem occurred when starting %s", pathname);
-			goto end;
 		}
-	}
 
+		free(alloc_pathname);
+	}
 end:
 	return ret;
 }
-- 
1.8.1.3




More information about the lttng-dev mailing list