From: Michael Wallner Date: Wed, 21 Oct 2015 10:06:08 +0000 (+0200) Subject: fix leak with strings! X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=f50ad180fe1508009e848fcefeda3b55562b4fcd;p=m6w6%2Fext-psi fix leak with strings! --- diff --git a/src/module.c b/src/module.c index dba74c5..4e7f4ce 100644 --- a/src/module.c +++ b/src/module.c @@ -289,6 +289,18 @@ void psi_do_clean(impl *impl) { size_t i; + for (i = 0; i < impl->func->args->count; ++i ) { + impl_arg *iarg = impl->func->args->args[i]; + + switch (iarg->type->type) { + case PSI_T_STRING: + if (iarg->val.str) { + zend_string_release(iarg->val.str); + } + break; + } + } + for (i = 0; i < impl->decl->args->count; ++i) { decl_arg *darg = impl->decl->args->args[i]; diff --git a/tests/idn/idn003.phpt b/tests/idn/idn003.phpt new file mode 100644 index 0000000..8befdc9 --- /dev/null +++ b/tests/idn/idn003.phpt @@ -0,0 +1,24 @@ +--TEST-- +libidn +--INI-- +psi.directory={PWD} +--SKIPIF-- + +--FILE-- +===TEST=== + +===DONE=== +--EXPECT-- +===TEST=== +xn--bcher-kva.de +Success +===DONE=== \ No newline at end of file diff --git a/tests/idn/idn004.phpt b/tests/idn/idn004.phpt new file mode 100644 index 0000000..d70f307 --- /dev/null +++ b/tests/idn/idn004.phpt @@ -0,0 +1,30 @@ +--TEST-- +libidn +--INI-- +psi.directory={PWD} +--SKIPIF-- + +--FILE-- +===TEST=== + +===DONE=== +--EXPECT-- +===TEST=== +xn--bcher-kva.de +Success +xn--bcher2-3ya.de +Success +===DONE=== \ No newline at end of file