From: Jérémie Galarneau Date: Tue, 8 Oct 2019 19:15:28 +0000 (-0400) Subject: Fix: sessiond: double socket close on allocation failure X-Git-Tag: v2.12.0-rc1~315 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=229afb9c2b86080bfd645d39ae101a3c3389c622;p=lttng-tools.git Fix: sessiond: double socket close on allocation failure 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 --- 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; }