COMMON: Fix a memory leak in Common::DumpFile

This commit is contained in:
Bastien Bouclet 2019-06-01 13:59:08 +02:00
parent 5eed7f091d
commit fd4fa5e899

View file

@ -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;
}
}
}