From: Karel Zak Date: Mon, 8 Dec 2008 14:32:44 +0000 (+0100) Subject: blkid: fix file descriptor leak when checking for a module X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=11d925c6089bd4a06efd686da202ec87d391b264;p=util-linux blkid: fix file descriptor leak when checking for a module [kzak@redhat.com: port from e2fsprogs to util-linux-ng tree] Signed-off-by: Karel Zak --- diff --git a/libs/blkid/src/probers/ext.c b/libs/blkid/src/probers/ext.c index 26cc679e..27f41419 100644 --- a/libs/blkid/src/probers/ext.c +++ b/libs/blkid/src/probers/ext.c @@ -371,8 +371,10 @@ static int check_for_modules(const char *fs_name) if (!strcmp(t, ".ko")) *t = 0; } - if (!strcmp(cp, fs_name)) + if (!strcmp(cp, fs_name)) { + fclose(f); return 1; + } } fclose(f); #endif /* __linux__ */