summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorshennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-01-01 22:41:53 +0000
committershennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-01-01 22:41:53 +0000
commit83525765407b5e43517dff05c06828cf5a55d4d8 (patch)
tree3ac9489b917be3dfb184d2efab972b038b9d6bde /src
parentba96b8da39a53d2ee50539bfb6b7975446b4d9fe (diff)
downloadhercules-83525765407b5e43517dff05c06828cf5a55d4d8.tar.gz
hercules-83525765407b5e43517dff05c06828cf5a55d4d8.tar.bz2
hercules-83525765407b5e43517dff05c06828cf5a55d4d8.tar.xz
hercules-83525765407b5e43517dff05c06828cf5a55d4d8.zip
Fixed memory issue with fakename in parseGlobalMessage, bugreport:5192
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15349 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/map/clif.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index 1054ec66a..788896536 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -9122,7 +9122,7 @@ void clif_parse_GlobalMessage(int fd, struct map_session_data* sd)
* Fake Name Design by FatalEror (bug report #9)
**/
if( ( is_fake = ( sd->fakename[0] ) ) ) {
- fakename = (char*) malloc(strlen(sd->fakename)+messagelen+3);
+ fakename = (char*) aMalloc(strlen(sd->fakename)+messagelen+3);
strcpy(fakename, sd->fakename);
strcat(fakename, " : ");
strcat(fakename, message);
@@ -9142,6 +9142,7 @@ void clif_parse_GlobalMessage(int fd, struct map_session_data* sd)
WFIFOW(fd,0) = 0x8e;
WFIFOW(fd,2) = textlen + 4;
safestrncpy((char*)WFIFOP(fd,4), fakename, textlen);
+ aFree(fakename);
} else {
memcpy(WFIFOP(fd,0), RFIFOP(fd,0), RFIFOW(fd,2));
WFIFOW(fd,0) = 0x8e;