]> err.no Git - util-linux/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>
Mon, 26 Nov 2007 13:04:15 +0000 (14:04 +0100)
Signed-off-by: Matthias Koenig <mkoenig@suse.de>
mount/lomount.c

index 5bd8954076e72867b32524ea1a235f3c80f81914..d91a99f3437965eb3ae6ff9cee559212109f82a7 100644 (file)
@@ -396,6 +396,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);