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.11.0~12 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=2d70c828d492c82381300aeef48cdc4eeec33bf6;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; }