From: Theodore Ts'o Date: Sat, 11 Oct 2008 15:07:23 +0000 (-0400) Subject: libblkid: Fix file descriptor leak when checking for a module X-Git-Tag: v1.41.3~4 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=6964a17720ca88acd2075b57dde9c381f093e492;p=tools%2Fe2fsprogs.git libblkid: Fix file descriptor leak when checking for a module Signed-off-by: "Theodore Ts'o" --- diff --git a/lib/blkid/probe.c b/lib/blkid/probe.c index 71b00f4..a55bceb 100644 --- a/lib/blkid/probe.c +++ b/lib/blkid/probe.c @@ -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