OSDN Git Service

libblkid: Fix file descriptor leak when checking for a module
authorTheodore Ts'o <tytso@mit.edu>
Sat, 11 Oct 2008 15:07:23 +0000 (11:07 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 13 Oct 2008 03:12:22 +0000 (23:12 -0400)
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
lib/blkid/probe.c

index 71b00f4..a55bceb 100644 (file)
@@ -233,8 +233,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