diff options
Diffstat (limited to 'extmod/modure.c')
-rw-r--r-- | extmod/modure.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/extmod/modure.c b/extmod/modure.c index 78de4706d..d0180881d 100644 --- a/extmod/modure.c +++ b/extmod/modure.c @@ -144,7 +144,7 @@ STATIC mp_obj_t re_split(size_t n_args, const mp_obj_t *args) { } mp_obj_t retval = mp_obj_new_list(0, NULL); - const char **caps = alloca(caps_num * sizeof(char*)); + const char **caps = mp_local_alloc(caps_num * sizeof(char*)); while (true) { // cast is a workaround for a bug in msvc: it treats const char** as a const pointer instead of a pointer to pointer to const char memset((char**)caps, 0, caps_num * sizeof(char*)); @@ -165,6 +165,7 @@ STATIC mp_obj_t re_split(size_t n_args, const mp_obj_t *args) { break; } } + mp_local_free(caps); mp_obj_t s = mp_obj_new_str_of_type(str_type, (const byte*)subj.begin, subj.end - subj.begin); mp_obj_list_append(retval, s); |