From: Michael Wallner Date: Wed, 31 Oct 2018 11:31:38 +0000 (+0100) Subject: fix leaks X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=4cf4913076ea959f298caefb4b9d60510c1bf48b;p=m6w6%2Fext-psi fix leaks --- diff --git a/src/call.c b/src/call.c index 2c18e9b..c5aa4b7 100644 --- a/src/call.c +++ b/src/call.c @@ -199,13 +199,15 @@ zval *psi_call_frame_sub_argument(struct psi_call_frame *frame, if (!iarg) { struct psi_call_frame_argument *frame_arg; impl_val empty_val = {0}; + zend_string *type_str = zend_string_init(ZEND_STRL("mixed"), 1); struct psi_impl_arg *carg_spec = psi_impl_arg_init( - psi_impl_type_init(PSI_T_MIXED, zend_string_init(ZEND_STRL("mixed"), 1)), + psi_impl_type_init(PSI_T_MIXED, type_str), psi_impl_var_copy(inner_var), NULL); psi_call_frame_push_auto_ex(frame, carg_spec, (void(*)(void*)) psi_impl_arg_free); frame_arg = psi_call_frame_argument_init(carg_spec, &empty_val, inner_zval, 0); zend_hash_add_ptr(&frame->arguments, name, frame_arg); + zend_string_release(type_str); } return inner_zval; diff --git a/src/types/let_func.c b/src/types/let_func.c index ae8832f..ea2f371 100644 --- a/src/types/let_func.c +++ b/src/types/let_func.c @@ -350,11 +350,12 @@ static void *exec_let_func_arrval(struct psi_let_exp *val, if (frame_arg->zval_ptr) { while (psi_plist_get(func->inner, i++, &inner)) { - darg_member = psi_decl_arg_get_by_name(darg_members, - psi_let_exp_get_decl_var_name(inner)); + zend_string *var_name = psi_let_exp_get_decl_var_name(inner); + darg_member = psi_decl_arg_get_by_name(darg_members, var_name); exec_let_func_arrval_inner(func, darg, darg_member, frame_arg, inner, container, frame); + zend_string_release(var_name); } } } else if (func->inner) {