From d1fda6a944d29aaa522faadca76e2655b489b107 Mon Sep 17 00:00:00 2001 From: codemaster Date: Sun, 2 Jan 2005 09:10:48 +0000 Subject: [PATCH] * More atempts at memory leak fixes [Codemaster] [SVN 890] git-svn-id: https://svn.code.sf.net/p/rathena/svn/branches/stable@890 54d463be-8e91-2dee-dedb-b68131a5f0ec --- Changelog.txt | 4 +++- src/map/map.c | 15 ++++++++++++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/Changelog.txt b/Changelog.txt index 493f64a6f0..361bfdabdf 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,6 +1,8 @@ Date Added +01/02 + * More atempts at memory leak fixes [Codemaster] [SVN 890] 01/01 - * Attempted to fix a memory leak [Codemaster] - tell me if it works XD (NPC/Mob memory leak in npc_parse_mob(...)) + * Attempted to fix a memory leak [Codemaster] - tell me if it works XD (NPC/Mob memory leak in npc_parse_mob(...)) [SVN 886] * Added a char config that allows GMs that have a certain level or above to bypass the server's user limit [Codemaster] * Changed some create arrow outputs for new kRO 12/21/04 patch [Aria] diff --git a/src/map/map.c b/src/map/map.c index 99d38d1ae5..ae99c477b9 100644 --- a/src/map/map.c +++ b/src/map/map.c @@ -2540,13 +2540,22 @@ int id_db_final(void *k,void *d,va_list ap) nullpo_retr(0, id=d); if(id->lootitem) free(id->lootitem); - free(id); + if(id) + free(id); + return 0; +} +int map_db_final(void *k,void *d,va_list ap) +{ + struct map_data *id; + nullpo_retr(0, id=d); + if(id->gat) + free(id->gat); + if(id) + free(id); return 0; } -int map_db_final(void *k,void *d,va_list ap){ return 0; } int nick_db_final(void *k,void *d,va_list ap){ return 0; } int charid_db_final(void *k,void *d,va_list ap){ return 0; } - static int cleanup_sub(struct block_list *bl, va_list ap) { nullpo_retr(0, bl);