Fix: Use after free() of the rundir string
[lttng-tools.git] / src / bin / lttng-sessiond / main.c
index cf15ff9b02a4aec563614c699ec161f221f270ee..b4755b0b8cce0d7eba70d60d4a474345ba2bbd1c 100644 (file)
@@ -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);
This page took 0.0244180000000001 seconds and 5 git commands to generate.