Re: [PATCH] readline extension rl_bind_key addition and other enhancements
| From: | Nikita Popov | Date: | Wed, 14 Mar 2012 20:47:43 +0000 |
| Subject: | Re: [PATCH] readline extension rl_bind_key addition and other enhancements | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-58937@lists.php.net to get a copy of this message | ||
On Tue, Mar 13, 2012 at 10:46 AM, Osama Abu Elsorour
<osama.sorour@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