Fix: close fd on create unix sock error path
authorDavid Goulet <dgoulet@efficios.com>
Tue, 14 May 2013 16:33:15 +0000 (12:33 -0400)
committerDavid Goulet <dgoulet@efficios.com>
Tue, 14 May 2013 16:33:15 +0000 (12:33 -0400)
Issue 1019915 of coverity scan.

Signed-off-by: David Goulet <dgoulet@efficios.com>
src/common/sessiond-comm/unix.c

index fea56e8efa19a404bc1170627ef5300101a39f4a..48fa1049ac99e6d597e8982bceb5e4cfcf9236fe 100644 (file)
@@ -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;
 }
 
This page took 0.027139 seconds and 5 git commands to generate.