summaryrefslogtreecommitdiff
path: root/src/resources
diff options
context:
space:
mode:
Diffstat (limited to 'src/resources')
-rw-r--r--src/resources/colordb.cpp3
-rw-r--r--src/resources/mapdb.cpp3
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)
{