s3-param: Don't leak file descriptor. Reviewed-by: Alexander Bokovoy <ab@samba.org>
authorAndreas Schneider <asn@samba.org>
Wed, 20 Feb 2013 08:15:26 +0000 (09:15 +0100)
committerKarolin Seeger <kseeger@samba.org>
Wed, 27 Feb 2013 10:40:53 +0000 (11:40 +0100)
source3/param/loadparm.c

index 0e1b019cfeec351338ba33791decd1737ae0ab28..cbcab785e80ae73b16e4bf51e06919e39098618d 100644 (file)
@@ -4399,6 +4399,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;
        }