summaryrefslogtreecommitdiff
path: root/src/resources/mapreader.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-02-20 00:25:42 +0200
committerAndrei Karas <akaras@inbox.ru>2011-02-20 00:25:42 +0200
commit3f00faa305201fabcc74e17dc24da4cefa9dbfa5 (patch)
tree460a7a06c97912e5ed9a525f01624748dd7a16a6 /src/resources/mapreader.cpp
parentda9ec0b7b8e061b3d3bf1d145284de9d778456c1 (diff)
downloadmanaplus-3f00faa305201fabcc74e17dc24da4cefa9dbfa5.tar.gz
manaplus-3f00faa305201fabcc74e17dc24da4cefa9dbfa5.tar.bz2
manaplus-3f00faa305201fabcc74e17dc24da4cefa9dbfa5.tar.xz
manaplus-3f00faa305201fabcc74e17dc24da4cefa9dbfa5.zip
Fix some code style and some errors.
Diffstat (limited to 'src/resources/mapreader.cpp')
-rw-r--r--src/resources/mapreader.cpp3
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;