summaryrefslogtreecommitdiff
path: root/src/char/int_quest.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/char/int_quest.c')
-rw-r--r--src/char/int_quest.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/char/int_quest.c b/src/char/int_quest.c
index fb90e8206..ce63a5581 100644
--- a/src/char/int_quest.c
+++ b/src/char/int_quest.c
@@ -38,7 +38,7 @@ struct quest *mapif_quests_fromsql(int char_id, int *count) {
stmt = SQL->StmtMalloc(sql_handle);
if (stmt == NULL) {
SqlStmt_ShowDebug(stmt);
- return 0;
+ return NULL;
}
memset(&tmp_quest, 0, sizeof(struct quest));
@@ -70,7 +70,7 @@ struct quest *mapif_quests_fromsql(int char_id, int *count) {
memcpy(&questlog[i++], &tmp_quest, sizeof(tmp_quest));
}
if (i < *count) {
- // Should never. Compact array
+ // Should never happen. Compact array
*count = i;
questlog = aRealloc(questlog, sizeof(struct quest)*i);
}
@@ -215,6 +215,9 @@ int mapif_parse_quest_load(int fd) {
WFIFOSET(fd,num_quests*sizeof(struct quest)+8);
+ if (tmp_questlog)
+ aFree(tmp_questlog);
+
return 0;
}