From 6964a17720ca88acd2075b57dde9c381f093e492 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Sat, 11 Oct 2008 11:07:23 -0400 Subject: [PATCH] libblkid: Fix file descriptor leak when checking for a module Signed-off-by: "Theodore Ts'o" --- lib/blkid/probe.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 -- 1.8.3.1