From 83525765407b5e43517dff05c06828cf5a55d4d8 Mon Sep 17 00:00:00 2001 From: shennetsind Date: Sun, 1 Jan 2012 22:41:53 +0000 Subject: 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 --- src/map/clif.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/map') 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; -- cgit v1.2.3-70-g09d2