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=f7858f66f792c7862c28915fce467680e0f9c6b4;p=util-linux mount: fix fd leak Signed-off-by: Matthias Koenig --- diff --git a/mount/lomount.c b/mount/lomount.c index 5bd89540..d91a99f3 100644 --- a/mount/lomount.c +++ b/mount/lomount.c @@ -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);