From 229afb9c2b86080bfd645d39ae101a3c3389c622 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Tue, 8 Oct 2019 15:15:28 -0400 Subject: [PATCH] Fix: sessiond: double socket close on allocation failure MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- src/bin/lttng-sessiond/register.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/bin/lttng-sessiond/register.c b/src/bin/lttng-sessiond/register.c index c7e3de66f..36e1a0d31 100644 --- a/src/bin/lttng-sessiond/register.c +++ b/src/bin/lttng-sessiond/register.c @@ -278,6 +278,7 @@ static void *thread_application_registration(void *data) if (ret) { PERROR("close"); } + sock = -1; goto error; } -- 2.34.1