summaryrefslogtreecommitdiff
path: root/src/resources
diff options
context:
space:
mode:
Diffstat (limited to 'src/resources')
-rw-r--r--src/resources/db/deaddb.cpp10
-rw-r--r--src/resources/db/itemfielddb.cpp7
-rw-r--r--src/resources/db/questdb.cpp3
3 files changed, 17 insertions, 3 deletions
diff --git a/src/resources/db/deaddb.cpp b/src/resources/db/deaddb.cpp
index 251ae3a33..778d88a0b 100644
--- a/src/resources/db/deaddb.cpp
+++ b/src/resources/db/deaddb.cpp
@@ -73,11 +73,17 @@ void DeadDB::loadXmlFile(const std::string &fileName,
}
else if (xmlNameEqual(node, "message"))
{
- const char *const data = reinterpret_cast<const char*>(
+ char *const data = reinterpret_cast<char*>(
XmlNodeGetContent(node));
- if (!data || !*data)
+ if (!data)
continue;
+ if (!*data)
+ {
+ XmlFree(data);
+ continue;
+ }
mMessages.push_back(data);
+ XmlFree(data);
}
}
diff --git a/src/resources/db/itemfielddb.cpp b/src/resources/db/itemfielddb.cpp
index 17f9b61e1..0eeb7f901 100644
--- a/src/resources/db/itemfielddb.cpp
+++ b/src/resources/db/itemfielddb.cpp
@@ -86,6 +86,13 @@ static void loadFields(const XmlNodePtr groupNode,
name.c_str());
continue;
}
+ if (fields1.find(name) != fields1.end())
+ {
+ reportAlways(
+ "Same field name detected: %s",
+ name.c_str());
+ continue;
+ }
fields1[name] = new ItemFieldType(name,
description,
sign);
diff --git a/src/resources/db/questdb.cpp b/src/resources/db/questdb.cpp
index 93bcada6e..da05721b1 100644
--- a/src/resources/db/questdb.cpp
+++ b/src/resources/db/questdb.cpp
@@ -83,11 +83,12 @@ static void loadQuest(const int var,
{
if (!xmlTypeEqual(dataNode, XML_ELEMENT_NODE))
continue;
- const char *const data = reinterpret_cast<const char*>(
+ char *const data = reinterpret_cast<char*>(
XmlNodeGetContent(dataNode));
if (!data)
continue;
std::string str = translator->getStr(data);
+ XmlFree(data);
for (int f = 1; f < 100; f ++)
{