From 1afeabfe1893f5dc6206658aad48544b2002e555 Mon Sep 17 00:00:00 2001 From: Haru Date: Wed, 28 Aug 2013 18:09:12 +0200 Subject: Fixed an error with the '+=' operator on string variables When attempting to concatenate and assign to a previously empty string with +=, it'd throw a memory manager error. Follow-up to 22d2718. Signed-off-by: Haru --- src/map/script.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/map/script.c b/src/map/script.c index 05b7e6b57..6413b9a60 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -3067,7 +3067,8 @@ void op_2(struct script_state *st, int op) if (leftref.type != C_NOP) { - aFree(left->u.str); + if (left->type == C_STR) // don't free C_CONSTSTR + aFree(left->u.str); *left = leftref; } } -- cgit v1.2.3-70-g09d2