diff options
-rw-r--r-- | common/file.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/common/file.cpp b/common/file.cpp index 6320838e0b..0d760cb509 100644 --- a/common/file.cpp +++ b/common/file.cpp @@ -162,8 +162,12 @@ bool DumpFile::open(const String &filename, bool createPath) { subpath.erase(i); if (subpath.empty()) continue; AbstractFSNode *node = g_system->getFilesystemFactory()->makeFileNodePath(subpath); - if (node->exists()) continue; + if (node->exists()) { + delete node; + continue; + } if (!node->create(true)) warning("DumpFile: unable to create directories from path prefix"); + delete node; } } } |