Blob Blame Raw
From 97359edba99f9bc6f3f87590da2139c51fb409d4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Lyson=C4=9Bk?= <olysonek@redhat.com>
Date: Mon, 13 Aug 2018 14:39:45 +0200
Subject: [PATCH 4/7] Fix a directory handle leak
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
---
 src/getsdir.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/getsdir.c b/src/getsdir.c
index 2195b27..bd6b763 100644
--- a/src/getsdir.c
+++ b/src/getsdir.c
@@ -228,6 +228,7 @@ int getsdir(const char *dirpath, const char *pattern, int sortflags,
           if (!*datptr)
             {
               free(*datptr);
+              closedir(dirp);
               return -1;
             }
 
-- 
2.14.4