Fix: various memleaks
[lttng-tools.git] / src / bin / lttng-sessiond / main.c
index 8d0a841ed8e71cc88a2f5a7d688ecbf1e3c49d3e..0c4d4b1f9b544f3916caaec859cd6c2cff06a27b 100644 (file)
@@ -3798,7 +3798,7 @@ static void *thread_manage_clients(void *data)
                                PERROR("close");
                        }
                        sock = -1;
-                       free(cmd_ctx);
+                       clean_command_ctx(&cmd_ctx);
                        continue;
                }
 
@@ -4516,6 +4516,12 @@ int main(int argc, char **argv)
                goto error;
        }
 
+       /*
+        * Init UST app hash table. Alloc hash table before this point since
+        * cleanup() can get called after that point.
+        */
+       ust_app_ht_alloc();
+
        /* After this point, we can safely call cleanup() with "goto exit" */
 
        /*
@@ -4581,9 +4587,6 @@ int main(int argc, char **argv)
        /* Init UST command queue. */
        cds_wfq_init(&ust_cmd_queue.queue);
 
-       /* Init UST app hash table */
-       ust_app_ht_alloc();
-
        /*
         * Get session list pointer. This pointer MUST NOT be free(). This list is
         * statically declared in session.c
This page took 0.024781 seconds and 4 git commands to generate.