diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-02-17 13:36:49 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-02-17 13:36:49 +0000 |
commit | 25fac517af46dd681e1fe9b9d5bd1406ff9d1108 (patch) | |
tree | 19452a6a3c30828573e07b3da39c91e66a885bfe /src/map/script.c | |
parent | de9a845f5bf8493cb4e03da261340055972508b3 (diff) | |
download | hercules-25fac517af46dd681e1fe9b9d5bd1406ff9d1108.tar.gz hercules-25fac517af46dd681e1fe9b9d5bd1406ff9d1108.tar.bz2 hercules-25fac517af46dd681e1fe9b9d5bd1406ff9d1108.tar.xz hercules-25fac517af46dd681e1fe9b9d5bd1406ff9d1108.zip |
- Fixed the memory leak on opt_2str as pointed out by End of Exam
- Fixed a few char SQL memory leaks as pointed out by End of Exam
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5307 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/script.c')
-rw-r--r-- | src/map/script.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/map/script.c b/src/map/script.c index 19d52b026..6560d3281 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -9854,8 +9854,9 @@ void op_2str(struct script_state *st,int op,int sp1,int sp2) break;
}
- push_val(st->stack,C_INT,a);
-
+ // Because push_val() overwrite stack_data[sp1], C_STR on stack_data[sp1] won't be freed.
+ // So, call push_val() after freeing strings. [jA1783]
+ // push_val(st->stack,C_INT,a);
if(st->stack->stack_data[sp1].type==C_STR)
{
aFree(s1);
@@ -9866,6 +9867,7 @@ void op_2str(struct script_state *st,int op,int sp1,int sp2) aFree(s2);
st->stack->stack_data[sp2].type=C_INT;
}
+ push_val(st->stack,C_INT,a);
}
/*==========================================
* Zq(l)
|