diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-03-30 23:57:40 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-03-31 01:04:53 +0300 |
commit | 91a51ec64c35713914b22f2d9a283dc5b4091c12 (patch) | |
tree | 0289142a45284514a8981b02601c83ac1039dd5d /src/resources | |
parent | d629f56517f55d1fd756c4774d9a368d66f615df (diff) | |
download | manaplus-91a51ec64c35713914b22f2d9a283dc5b4091c12.tar.gz manaplus-91a51ec64c35713914b22f2d9a283dc5b4091c12.tar.bz2 manaplus-91a51ec64c35713914b22f2d9a283dc5b4091c12.tar.xz manaplus-91a51ec64c35713914b22f2d9a283dc5b4091c12.zip |
Fix memory leaks and some other errors.
Diffstat (limited to 'src/resources')
-rw-r--r-- | src/resources/colordb.cpp | 3 | ||||
-rw-r--r-- | src/resources/mapdb.cpp | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/src/resources/colordb.cpp b/src/resources/colordb.cpp index 5706c952c..30d7c4f0c 100644 --- a/src/resources/colordb.cpp +++ b/src/resources/colordb.cpp @@ -98,7 +98,10 @@ void ColorDB::loadColorLists() XML::Document *doc = new XML::Document("itemcolors.xml"); xmlNodePtr root = doc->rootNode(); if (!root) + { + delete doc; return; + } for_each_xml_child_node(node, root) { diff --git a/src/resources/mapdb.cpp b/src/resources/mapdb.cpp index 4050a5072..0b553e35d 100644 --- a/src/resources/mapdb.cpp +++ b/src/resources/mapdb.cpp @@ -45,7 +45,10 @@ void MapDB::load() xmlNodePtr root = doc->rootNode(); if (!root) + { + delete doc; return; + } for_each_xml_child_node(node, root) { |