Fix: thread_registration_apps should set its local sock to -1 when passing it
[lttng-tools.git] / src / bin / lttng-sessiond / main.c
index 17ef7f71c318b60990f36ebe6ea2b6bde326e647..9e4bab468f1462308f6c5377a049847015824e1b 100644 (file)
@@ -1431,6 +1431,7 @@ static void *thread_registration_apps(void *data)
                                        }
 
                                        ust_cmd->sock = sock;
+                                       sock = -1;
 
                                        DBG("UST registration received with pid:%d ppid:%d uid:%d"
                                                        " gid:%d sock:%d name:%s (version %d.%d)",
@@ -1465,7 +1466,7 @@ error:
                        PERROR("close");
                }
        }
-       if (clock >= 0) {
+       if (sock >= 0) {
                ret = close(sock);
                if (ret) {
                        PERROR("close");
This page took 0.023099 seconds and 4 git commands to generate.