From: Matthias Koenig Date: Wed, 21 Nov 2007 15:46:33 +0000 (+0100) Subject: mount: fix fd leak X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7645487b42adfa9eaf2bee81d80812cd227a90c5;p=util-linux mount: fix fd leak Signed-off-by: Matthias Koenig --- diff --git a/mount/lomount.c b/mount/lomount.c index 02548cc2..a94a7f0b 100644 --- a/mount/lomount.c +++ b/mount/lomount.c @@ -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);