summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-03-01 20:26:06 +0300
committerAndrei Karas <akaras@inbox.ru>2015-03-01 20:26:06 +0300
commit89b521023a1bef1ee7c0d8d901d0c9efab767d53 (patch)
tree2a9a0245e698003f367efc06f416969f691b38f5
parent778ebbc853430bbe0720612a4980cbe371d8186f (diff)
downloadevol-hercules-89b521023a1bef1ee7c0d8d901d0c9efab767d53.tar.gz
evol-hercules-89b521023a1bef1ee7c0d8d901d0c9efab767d53.tar.bz2
evol-hercules-89b521023a1bef1ee7c0d8d901d0c9efab767d53.tar.xz
evol-hercules-89b521023a1bef1ee7c0d8d901d0c9efab767d53.zip
fix memory leak in quest.c.
-rw-r--r--src/map/quest.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/map/quest.c b/src/map/quest.c
index aef112a..c2b85bf 100644
--- a/src/map/quest.c
+++ b/src/map/quest.c
@@ -55,15 +55,18 @@ struct quest_db *equest_read_db_sub(config_setting_t *cs, int *nPtr, const char
if (!libconfig->setting_lookup_int(cs, "Id", &quest_id)) {
ShowWarning("quest_read_db: Missing id in \"%s\", entry #%d, skipping.\n", source, n);
+ hookStop();
return NULL;
}
if (quest_id < 0 || quest_id >= MAX_QUEST_DB) {
ShowWarning("quest_read_db: Invalid quest ID '%d' in \"%s\", entry #%d (min: 0, max: %d), skipping.\n", quest_id, source, n, MAX_QUEST_DB);
+ hookStop();
return NULL;
}
if (!libconfig->setting_lookup_string(cs, "Name", &str) || !*str) {
ShowWarning("quest_read_db_sub: Missing Name in quest %d of \"%s\", skipping.\n", quest_id, source);
+ hookStop();
return NULL;
}
@@ -124,5 +127,6 @@ struct quest_db *equest_read_db_sub(config_setting_t *cs, int *nPtr, const char
entry->dropitem[entry->dropitem_count-1].rate = rate;
}
}
+ hookStop();
return entry;
}