From: Mathieu Desnoyers Date: Mon, 24 Aug 2015 18:41:42 +0000 (-0400) Subject: Fix: app cmd leak on sessiond exit X-Git-Tag: v2.6.1~42 X-Git-Url: https://git.liburcu.org/?a=commitdiff_plain;h=b9e9de0ae47d2d08717d7c1403ff81b9ac02e18e;p=lttng-tools.git Fix: app cmd leak on sessiond exit Signed-off-by: Mathieu Desnoyers Signed-off-by: Jérémie Galarneau Conflicts: src/bin/lttng-sessiond/main.c --- diff --git a/src/bin/lttng-sessiond/main.c b/src/bin/lttng-sessiond/main.c index 7451b2c96..1548dc5df 100644 --- a/src/bin/lttng-sessiond/main.c +++ b/src/bin/lttng-sessiond/main.c @@ -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) {