summaryrefslogtreecommitdiff
path: root/src/map/clif.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/clif.c')
-rw-r--r--src/map/clif.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index 62273c0..c27bddf 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -7165,15 +7165,10 @@ void clif_parse_GlobalMessage (int fd, struct map_session_data *sd)
int clif_message (struct block_list *bl, char *msg)
{
unsigned short msg_len = strlen (msg) + 1;
- static int buf_len = -1;
- static unsigned char *buf = NULL;
+ unsigned char buf[512];
- if (buf_len < msg_len)
- {
- if (buf)
- free (buf);
- buf = malloc (buf_len = (msg_len + 16));
- }
+ if (msg_len + 16 > 512)
+ return 0;
nullpo_retr (0, bl);