From b4656abb41ed0e8124bd7128e26ea583796c6104 Mon Sep 17 00:00:00 2001 From: Wang Renxin Date: Tue, 21 Jul 2015 17:06:06 +0800 Subject: [PATCH] *fixed a crash bug when met an empty string in PRINT --- core/my_basic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/my_basic.c b/core/my_basic.c index 65d75fb..b903b8f 100755 --- a/core/my_basic.c +++ b/core/my_basic.c @@ -78,7 +78,7 @@ extern "C" { /** Macros */ #define _VER_MAJOR 1 #define _VER_MINOR 1 -#define _VER_REVISION 58 +#define _VER_REVISION 59 #define _MB_VERSION ((_VER_MAJOR * 0x01000000) + (_VER_MINOR * 0x00010000) + (_VER_REVISION)) /* Uncomment this line to treat warnings as error */ @@ -6338,7 +6338,7 @@ int _std_print(mb_interpreter_t* s, void** l) { _get_printer(s)(MB_REAL_FMT, val_ptr->data.float_point); } else if(val_ptr->type == _DT_STRING) { _get_printer(s)("%s", (val_ptr->data.string ? val_ptr->data.string : MB_NULL_STRING)); - if(!val_ptr->ref) { + if(!val_ptr->ref && val_ptr->data.string) { safe_free(val_ptr->data.string); } }