]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
mount: fix fd leak
authorMatthias Koenig <mkoenig@suse.de>
Wed, 21 Nov 2007 15:46:33 +0000 (16:46 +0100)
committerKarel Zak <kzak@redhat.com>
Wed, 5 Dec 2007 10:51:51 +0000 (11:51 +0100)
Signed-off-by: Matthias Koenig <mkoenig@suse.de>
mount/lomount.c

index 02548cc2ececcde8e0859bad3822d08ba584effc..a94a7f0b353bf42c77bb1adbd9903dc64c48c9e0 100644 (file)
@@ -291,6 +291,7 @@ set_loop(const char *device, const char *file, unsigned long long offset,
        }
        if ((fd = open(device, mode)) < 0) {
                perror (device);
+               close(ffd);
                return 1;
        }
        *loopro = (mode == O_RDONLY);