[PATCH 4/6] Fix a directory handle leak

Ondřej Lysoněk olysonek at redhat.com
Mon Jul 30 16:11:10 BST 2018


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

diff --git a/src/getsdir.c b/src/getsdir.c
index fbf8271..322a253 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




More information about the minicom-devel mailing list