lib-util: Don't leak file descriptor on error.
authorAndreas Schneider <asn@samba.org>
Wed, 20 Feb 2013 09:48:05 +0000 (10:48 +0100)
committerAlexander Bokovoy <ab@samba.org>
Fri, 22 Feb 2013 15:36:14 +0000 (16:36 +0100)
Reviewed-by: Alexander Bokovoy <ab@samba.org>
lib/util/become_daemon.c

index 373927ca6ea95def39716e5aae4189e54897e7b9..2ca047861f18321c4e173d901ace0e56dcb943fb 100644 (file)
@@ -62,6 +62,7 @@ _PUBLIC_ void close_low_fds(bool stdin_too, bool stdout_too, bool stderr_too)
                }
                if (fd != i) {
                        DEBUG(0,("Didn't get file descriptor %d\n",i));
+                       close(fd);
                        return;
                }
        }