aboutsummaryrefslogtreecommitdiff
path: root/backend/session/direct-ipc.c
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2018-06-30 12:57:48 +0100
committerGitHub <noreply@github.com>2018-06-30 12:57:48 +0100
commit167105e6069d2dd66cd2d472c2a6b67703838125 (patch)
treee6626f03fdd94c7832c4b5cb3b97e2a61cf6602e /backend/session/direct-ipc.c
parent63eb720871004219826f16e0a79a0014ac5516e4 (diff)
parent0c2a64df18f8740ab795fb2970d1954a8aac34b1 (diff)
Merge pull request #1101 from martinetd/static-analysis
Static analysis fixes
Diffstat (limited to 'backend/session/direct-ipc.c')
-rw-r--r--backend/session/direct-ipc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/backend/session/direct-ipc.c b/backend/session/direct-ipc.c
index f8ba07f7..2dd777c8 100644
--- a/backend/session/direct-ipc.c
+++ b/backend/session/direct-ipc.c
@@ -159,7 +159,9 @@ static void communicate(int sock) {
}
error:
send_msg(sock, ret ? -1 : fd, &ret, sizeof(ret));
- close(fd);
+ if (fd >= 0) {
+ close(fd);
+ }
break;