]> err.no Git - util-linux/commitdiff
blkid: fix file descriptor leak when checking for a module
authorKarel Zak <kzak@redhat.com>
Mon, 8 Dec 2008 14:32:44 +0000 (15:32 +0100)
committerKarel Zak <kzak@redhat.com>
Wed, 11 Feb 2009 22:21:50 +0000 (23:21 +0100)
[kzak@redhat.com: port from e2fsprogs to util-linux-ng tree]

Signed-off-by: Karel Zak <kzak@redhat.com>
libs/blkid/src/probers/ext.c

index 26cc679e560e75f555b41121197d724705714010..27f414192103bed2027be424ea57cf0cc510c583 100644 (file)
@@ -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__ */