From 6c40ba037eb10463861438f5de4b86ca7a1ec714 Mon Sep 17 00:00:00 2001 From: Wang Renxin Date: Tue, 3 Nov 2015 14:03:04 +0800 Subject: [PATCH] *fixed a memory leak with string manipulation. --- core/my_basic.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/my_basic.c b/core/my_basic.c index da4c0e2..5620515 100755 --- a/core/my_basic.c +++ b/core/my_basic.c @@ -81,7 +81,7 @@ extern "C" { /** Macros */ #define _VER_MAJOR 1 #define _VER_MINOR 1 -#define _VER_REVISION 96 +#define _VER_REVISION 97 #define _VER_SUFFIX #define _MB_VERSION ((_VER_MAJOR * 0x01000000) + (_VER_MINOR * 0x00010000) + (_VER_REVISION)) #define _STRINGIZE(A) _MAKE_STRINGIZE(A) @@ -2727,6 +2727,7 @@ int _calc_expression(mb_interpreter_t* s, _ls_node_t** l, _object_t** val) { (*val)->data.string = (char*)mb_malloc(_sl + 1); (*val)->data.string[_sl] = '\0'; memcpy((*val)->data.string, _str, _sl + 1); + (*val)->ref = false; } else if(c->type == _DT_ARRAY) { (*val)->data = c->data; c->type = _DT_NIL;