s3-param: Don't leak file descriptor.
authorAndreas Schneider <asn@samba.org>
Wed, 20 Feb 2013 08:15:26 +0000 (09:15 +0100)
committerAlexander Bokovoy <ab@samba.org>
Fri, 22 Feb 2013 15:36:13 +0000 (16:36 +0100)
Reviewed-by: Alexander Bokovoy <ab@samba.org>
source3/param/loadparm.c

index 5bf430da4e50bc09c2b31df19e620ad51265ad48..ce1c1d82b3b3f88f035251a45f46a8b4252ce12e 100644 (file)
@@ -4432,6 +4432,7 @@ static int process_usershare_file(const char *dir_name, const char *file_name, i
        /* This must be a regular file, not a symlink, directory or
           other strange filetype. */
        if (!check_usershare_stat(fname, &sbuf)) {
+               close(fd);
                goto out;
        }