Fix safe list iteration
[lttng-tools.git] / ltt-sessiond / main.c
index 380aa7d9c95e5cb40c9df1f6b27ee98f00587df0..bba8aa64d4dfebcb4a3c35150969c72070af7fb2 100644 (file)
@@ -150,7 +150,7 @@ static void cleanup()
 {
        int ret;
        char *cmd;
-       struct ltt_session *sess;
+       struct ltt_session *sess, *stmp;
 
        DBG("Cleaning up");
 
@@ -184,7 +184,7 @@ static void cleanup()
                pthread_mutex_destroy(&session_list_ptr->lock);
 
                /* Cleanup ALL session */
-               cds_list_for_each_entry(sess, &session_list_ptr->head, list) {
+               cds_list_for_each_entry_safe(sess, stmp, &session_list_ptr->head, list) {
                        teardown_kernel_session(sess);
                        // TODO complete session cleanup (including UST)
                }
This page took 0.025109 seconds and 5 git commands to generate.