On Tue, Mar 13, 2012 at 10:46 AM, Osama Abu Elsorour
<osama.sor...@eformations.net> wrote:
> [snip]
> +               zval *_temp_callback = NULL;
> +               MAKE_STD_ZVAL(_temp_callback);
> +               *_temp_callback = *arg;
> +               zval_copy_ctor(_temp_callback);
May I ask where you got this pattern for copying zvals from? Is this
kind of code shown in some tutorial / manual / etc? Such code is used
all other the place, instead of the MAKE_COPY_ZVAL macro and I wonder
why. Doing manual copying has a good chance of leaking memory. Just
from glancing I'd say that your code will leak if arg has a refcount >
1 (but I could be wrong) as it does not PINIT the zval after it was
copied.

Nikita

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to