From 908d434f0471537364dcc19376993400937f23c9 Mon Sep 17 00:00:00 2001 From: "(no author)" <(no author)@54d463be-8e91-2dee-dedb-b68131a5f0ec> Date: Wed, 26 Jan 2005 16:44:38 +0000 Subject: Fixed memory leak git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@999 54d463be-8e91-2dee-dedb-b68131a5f0ec --- Changelog.txt | 2 ++ src/map/map.c | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Changelog.txt b/Changelog.txt index 75bbc75d7..8b4eebfe9 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,6 +1,8 @@ Date Added 01/26 + * Added bug fix for a memory leak caused when a character logs out, + by End_of_exam / jA 1108 [celest] * Fixed a bug in gettick cache when compiling in Windows, thanks to Shinomori (jA 1094) [celest] * Added updates from jA 1092 [celest] diff --git a/src/map/map.c b/src/map/map.c index 8dd538015..e942ead50 100644 --- a/src/map/map.c +++ b/src/map/map.c @@ -1085,7 +1085,13 @@ int map_quit(struct map_session_data *sd) { chrif_char_offline(sd); #endif - numdb_erase(id_db,sd->bl.id); + { + void *p = numdb_search(charid_db,sd->status.char_id); + if(p) { + numdb_erase(charid_db,sd->status.char_id); + free(p); + } + } strdb_erase(nick_db,sd->status.name); numdb_erase(charid_db,sd->status.char_id); -- cgit v1.2.3-70-g09d2