Fix: close fd on create unix sock error path
[lttng-tools.git] / 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.02558 seconds and 5 git commands to generate.