Fix: app cmd leak on sessiond exit
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 24 Aug 2015 18:41:42 +0000 (14:41 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 24 Sep 2015 02:09:09 +0000 (22:09 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
 Conflicts:
src/bin/lttng-sessiond/main.c

src/bin/lttng-sessiond/main.c

index 7451b2c96ad74ca086780cc50ecbfe766af589bc..1548dc5df79628e6dd2df5a7b582a5f2cfe7d537 100644 (file)
@@ -1949,6 +1949,22 @@ error:
                free(wait_node);
        }
 
+       /* Empty command queue. */
+       for (;;) {
+               /* Dequeue command for registration */
+               node = cds_wfcq_dequeue_blocking(&ust_cmd_queue.head, &ust_cmd_queue.tail);
+               if (node == NULL) {
+                       break;
+               }
+               ust_cmd = caa_container_of(node, struct ust_command, node);
+               ret = close(ust_cmd->sock);
+               if (ret < 0) {
+                       PERROR("close ust sock exit dispatch %d", ust_cmd->sock);
+               }
+               lttng_fd_put(LTTNG_FD_APPS, 1);
+               free(ust_cmd);
+       }
+
 error_testpoint:
        DBG("Dispatch thread dying");
        if (err) {
This page took 0.027803 seconds and 4 git commands to generate.