From 17e7527387f4c002b6e20d6b09444ce521f8117f Mon Sep 17 00:00:00 2001 From: David Goulet Date: Tue, 14 May 2013 12:33:15 -0400 Subject: [PATCH] Fix: close fd on create unix sock error path Issue 1019915 of coverity scan. Signed-off-by: David Goulet --- src/common/sessiond-comm/unix.c | 5 +++++ 1 file changed, 5 insertions(+) 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; } -- 2.34.1