diff options
Diffstat (limited to 'src/resources/mapreader.cpp')
-rw-r--r-- | src/resources/mapreader.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/resources/mapreader.cpp b/src/resources/mapreader.cpp index 808615ae9..5a635a8c2 100644 --- a/src/resources/mapreader.cpp +++ b/src/resources/mapreader.cpp @@ -457,7 +457,10 @@ void MapReader::readLayer(xmlNodePtr node, Map *map) unsigned char *charData = new unsigned char[len + 1]; const char *charStart = (const char*) xmlNodeGetContent(dataChild); if (!charStart) + { + delete charData; return; + } unsigned char *charIndex = charData; |