diff options
author | ultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2008-10-08 13:15:35 +0000 |
---|---|---|
committer | ultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2008-10-08 13:15:35 +0000 |
commit | d530df5b85eb2f796fd51ae1fe3bdce843d9ca00 (patch) | |
tree | c504b3044b9f1dd6618449af701469a744465826 /src/map/script.c | |
parent | e98cb15c72c5a4cee3b7658b139504a8aa9c3a75 (diff) | |
download | hercules-d530df5b85eb2f796fd51ae1fe3bdce843d9ca00.tar.gz hercules-d530df5b85eb2f796fd51ae1fe3bdce843d9ca00.tar.bz2 hercules-d530df5b85eb2f796fd51ae1fe3bdce843d9ca00.tar.xz hercules-d530df5b85eb2f796fd51ae1fe3bdce843d9ca00.zip |
Fixed chat_createnpcchat() not checking if a chatroom already exists, producing memleaks in certain situations (bugreport:2325).
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13269 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/script.c')
-rw-r--r-- | src/map/script.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/map/script.c b/src/map/script.c index ceb0dab50..b7367c8fe 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -8461,8 +8461,11 @@ BUILDIN_FUNC(waitingroom) ev = script_getstr(st, 4); trigger = limit; } - if( (nd=(struct npc_data *)map_id2bl(st->oid)) != NULL ) + + nd = (struct npc_data *)map_id2bl(st->oid); + if( nd != NULL ) chat_createnpcchat(nd, title, limit, pub, trigger, ev); + return 0; } |