From: David Goulet Date: Tue, 14 May 2013 16:33:15 +0000 (-0400) Subject: Fix: close fd on create unix sock error path X-Git-Tag: v2.2.0-rc3~73 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=17e7527387f4c002b6e20d6b09444ce521f8117f;p=lttng-tools.git Fix: close fd on create unix sock error path Issue 1019915 of coverity scan. Signed-off-by: David Goulet --- diff --git a/src/common/sessiond-comm/unix.c b/src/common/sessiond-comm/unix.c index fea56e8ef..48fa1049a 100644 --- a/src/common/sessiond-comm/unix.c +++ b/src/common/sessiond-comm/unix.c @@ -125,6 +125,11 @@ int lttcomm_create_unix_sock(const char *pathname) return fd; error: + if (fd >= 0) { + if (close(fd) < 0) { + PERROR("close create unix sock"); + } + } return ret; }