Fix: sessiond: double socket close on allocation failure
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 8 Oct 2019 19:15:28 +0000 (15:15 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 8 Oct 2019 19:17:41 +0000 (15:17 -0400)
The application registration thread performs a double close() on
an application socket whenever it fails to allocate a ust_command.

Assign `-1` to `sock` after the initial close() to follow the
pattern of other close paths.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-sessiond/register.c

index c7e3de66ff1f22ac378731b8228f10b84634a30f..36e1a0d31f0a8524e3a47a5962b4ce7a4698f7ce 100644 (file)
@@ -278,6 +278,7 @@ static void *thread_application_registration(void *data)
                                                if (ret) {
                                                        PERROR("close");
                                                }
+                                               sock = -1;
                                                goto error;
                                        }
 
This page took 0.028777 seconds and 4 git commands to generate.