summaryrefslogtreecommitdiff
path: root/src/map/script.c
diff options
context:
space:
mode:
authorHelmut Grohne <helmut@subdivi.de>2010-01-19 20:33:25 +0100
committerJared Adams <jaxad0127@gmail.com>2010-01-19 18:39:39 +0000
commitea5866863cbdad80eb69351417018c6104c5f43b (patch)
treefae1aeadc4c7af1beda05dc41ac2e11a8b184020 /src/map/script.c
parent67e82f1a0bc2a9078cfe11e0add190fa7cc4b891 (diff)
downloadtmwa-ea5866863cbdad80eb69351417018c6104c5f43b.tar.gz
tmwa-ea5866863cbdad80eb69351417018c6104c5f43b.tar.bz2
tmwa-ea5866863cbdad80eb69351417018c6104c5f43b.tar.xz
tmwa-ea5866863cbdad80eb69351417018c6104c5f43b.zip
fixed a few memory leaks
Diffstat (limited to 'src/map/script.c')
-rw-r--r--src/map/script.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/map/script.c b/src/map/script.c
index 03a092e..0ede96c 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -6264,7 +6264,6 @@ int buildin_strmobinfo (struct script_state *st)
if (num == 1)
{
char *buf;
- buf = calloc (24, 1);
buf = mob_db[class].name;
push_str (st->stack, C_STR, buf);
return 0;
@@ -6272,7 +6271,6 @@ int buildin_strmobinfo (struct script_state *st)
else if (num == 2)
{
char *buf;
- buf = calloc (24, 1);
buf = mob_db[class].jname;
push_str (st->stack, C_STR, buf);
return 0;
@@ -6938,13 +6936,13 @@ int buildin_getsavepoint (struct script_state *st)
sd = script_rid2sd (st);
type = conv_num (st, &(st->stack->stack_data[st->start + 2]));
- mapname = calloc (24, 1);
x = sd->status.save_point.x;
y = sd->status.save_point.y;
switch (type)
{
case 0:
+ mapname = calloc (24, 1);
strncpy (mapname, sd->status.save_point.map, 23);
push_str (st->stack, C_STR, mapname);
break;