bfc729c
From 0f255ef2570478a855361937445a57a168c8629d Mon Sep 17 00:00:00 2001
bfc729c
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
bfc729c
Date: Thu, 23 Aug 2018 11:23:43 +0200
bfc729c
Subject: [PATCH 2/3] quotackeck: Fix a directory descriptor leak in scan_dir()
bfc729c
MIME-Version: 1.0
bfc729c
Content-Type: text/plain; charset=UTF-8
bfc729c
Content-Transfer-Encoding: 8bit
bfc729c
bfc729c
Signed-off-by: Petr Písař <ppisar@redhat.com>
bfc729c
---
bfc729c
 quotacheck.c | 1 +
bfc729c
 1 file changed, 1 insertion(+)
bfc729c
bfc729c
diff --git a/quotacheck.c b/quotacheck.c
bfc729c
index fd01dfc..2cdf475 100644
bfc729c
--- a/quotacheck.c
bfc729c
+++ b/quotacheck.c
bfc729c
@@ -538,6 +538,7 @@ static int scan_dir(const char *pathname)
bfc729c
 		if ((lstat(de->d_name, &st)) == -1) {
bfc729c
 			errstr(_("lstat: Cannot stat `%s/%s': %s\nGuess you'd better run fsck first !\nexiting...\n"),
bfc729c
 				pathname, de->d_name, strerror(errno));
bfc729c
+			closedir(dp);
bfc729c
 			goto out;
bfc729c
 		}
bfc729c
 
bfc729c
-- 
bfc729c
2.14.4
bfc729c