]> git.stg.codes - stg.git/blobdiff - projects/stargazer/plugins/store/files/file_store.cpp
Fix resource leak in file_store
[stg.git] / projects / stargazer / plugins / store / files / file_store.cpp
index 6d8de6c2c00b7f625a5083802bd333a9625f0424..890b2b6c107eb49c93721b9f39670cdeacfbf2be 100644 (file)
@@ -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;
             }