]> sourceware.org Git - lvm2.git/commitdiff
coverity: close socket before closing app
authorZdenek Kabelac <zkabelac@redhat.com>
Fri, 15 Jul 2016 13:42:01 +0000 (15:42 +0200)
committerZdenek Kabelac <zkabelac@redhat.com>
Fri, 15 Jul 2016 13:49:01 +0000 (15:49 +0200)
Opened socket descriptor goes out-of-sight still opened.
Close it - but since this happens before app exit, it
just fixed valgrind report.

libdaemon/server/daemon-server.c

index 7911dd6b4324dd5be816dfa74659fe7a8d843b2c..e4d7ce2018030ff77ef9103ad5b395c92aa4714b 100644 (file)
@@ -660,6 +660,10 @@ out:
                if (unlink(s.socket_path))
                        perror("unlink error");
 
+       if (s.socket_fd >= 0)
+               if (close(s.socket_fd))
+                       perror("scoket close");
+
        if (s.daemon_fini)
                if (!s.daemon_fini(&s))
                        failed = 1;
This page took 0.034741 seconds and 5 git commands to generate.