From ff837095e9e509d3e03ace33fe1010eef35ebd02 Mon Sep 17 00:00:00 2001 From: Maxim Mamontov Date: Wed, 31 Aug 2011 13:02:51 +0300 Subject: [PATCH] Fix resource leak in file_store --- projects/stargazer/plugins/store/files/file_store.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/projects/stargazer/plugins/store/files/file_store.cpp b/projects/stargazer/plugins/store/files/file_store.cpp index 6d8de6c2..890b2b6c 100644 --- a/projects/stargazer/plugins/store/files/file_store.cpp +++ b/projects/stargazer/plugins/store/files/file_store.cpp @@ -532,6 +532,7 @@ while ((entry = readdir(d))) errorStr += strerror(errno); errorStr += "'"; printfd(__FILE__, "FILES_STORE::RemoveDir() - unlink failed. Message: '%s'\n", strerror(errno)); + closedir(d); return -1; } } @@ -540,6 +541,7 @@ while ((entry = readdir(d))) { if (RemoveDir(str.c_str())) { + closedir(d); return -1; } -- 2.44.2