From: David Goulet Date: Tue, 30 Oct 2012 14:39:41 +0000 (-0400) Subject: Fix: Use after free() of the rundir string X-Git-Tag: v2.1.0-rc6~7 X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=commitdiff_plain;h=bd69add26f7f847b1d23766ec631f8e3fde4ec7c;ds=sidebyside Fix: Use after free() of the rundir string Signed-off-by: David Goulet --- diff --git a/src/bin/lttng-sessiond/main.c b/src/bin/lttng-sessiond/main.c index cf15ff9b0..b4755b0b8 100644 --- a/src/bin/lttng-sessiond/main.c +++ b/src/bin/lttng-sessiond/main.c @@ -412,6 +412,7 @@ static void cleanup(void) ERR("Unable to clean %s", rundir); } free(cmd); + free(rundir); DBG("Cleaning up all sessions"); @@ -3985,9 +3986,6 @@ int main(int argc, char **argv) health_init(&ustconsumer64_data.health); health_poll_update(&ustconsumer64_data.health); - /* Not needed anymore. */ - free(rundir); - /* Create thread to manage the client socket */ ret = pthread_create(&health_thread, NULL, thread_manage_health, (void *) NULL);