From: Zdenek Kabelac Date: Fri, 15 Jul 2016 13:42:01 +0000 (+0200) Subject: coverity: close socket before closing app X-Git-Tag: v2_02_161~4 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=4de7a843ebc5c9ed4c54225a1a062cf40534edaf;p=lvm2.git coverity: close socket before closing app Opened socket descriptor goes out-of-sight still opened. Close it - but since this happens before app exit, it just fixed valgrind report. --- diff --git a/libdaemon/server/daemon-server.c b/libdaemon/server/daemon-server.c index 7911dd6b4..e4d7ce201 100644 --- a/libdaemon/server/daemon-server.c +++ b/libdaemon/server/daemon-server.c @@ -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;