[PATCH 4/7] Fix a directory handle leak

Ondřej Lysoněk olysonek at redhat.com
Mon Aug 13 13:39:45 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 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




More information about the minicom-devel mailing list