aboutsummaryrefslogtreecommitdiff
path: root/backends/fs/windows
diff options
context:
space:
mode:
Diffstat (limited to 'backends/fs/windows')
-rw-r--r--backends/fs/windows/windows-fs.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/backends/fs/windows/windows-fs.cpp b/backends/fs/windows/windows-fs.cpp
index 96231b9a53..11bec1e2f6 100644
--- a/backends/fs/windows/windows-fs.cpp
+++ b/backends/fs/windows/windows-fs.cpp
@@ -197,11 +197,12 @@ const char *lastPathComponent(const Common::String &str) {
AbstractFilesystemNode *WindowsFilesystemNode::parent() const {
assert(_isValid || _isPseudoRoot);
- WindowsFilesystemNode *p = new WindowsFilesystemNode();
+ WindowsFilesystemNode *p = 0;
if (!_isPseudoRoot && _path.size() > 3) {
const char *start = _path.c_str();
const char *end = lastPathComponent(_path);
+ p = new WindowsFilesystemNode();
p->_path = String(start, end - start);
p->_isValid = true;
p->_isDirectory = true;