Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:58937 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 582 invoked from network); 14 Mar 2012 20:47:50 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Mar 2012 20:47:50 -0000 Authentication-Results: pb1.pair.com smtp.mail=nikita.ppv@googlemail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=nikita.ppv@googlemail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain googlemail.com designates 209.85.217.170 as permitted sender) X-PHP-List-Original-Sender: nikita.ppv@googlemail.com X-Host-Fingerprint: 209.85.217.170 mail-lb0-f170.google.com Received: from [209.85.217.170] ([209.85.217.170:59585] helo=mail-lb0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4A/50-32926-4F3016F4 for ; Wed, 14 Mar 2012 15:47:49 -0500 Received: by lbbgg13 with SMTP id gg13so1139679lbb.29 for ; Wed, 14 Mar 2012 13:47:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=W5suQ7Daru9K6ZuszWeZeeAbI+6gqNmSJiLgdfRQRYA=; b=yS55pk1xrScxeITxfAW5CQUFj3UAFoZRWhxFj5z8BW4LaneYqXF+UEl+tOkKFy6Ps0 NUP84kXmGj2U4VuJ2hIfUKQSrWq0KJRh2lbM4TbkCO2CjT7pcBH8pEAq6FEJZM9ygf1x eqMnG9Qt1pPJzYFtNnLpiPuY/vutcO7EvjTngZIDq4iMqX+5x/323Nyu0z9HazivE201 83ecLWB1iG5ZgCfSK3RhBUbhQ9o0KqQXsZRf4Gy6j2es3bLjTtGDKK3NtbnREJK+yVgX PmbbmEnvWEmMieT4zMCQMH0uIm4Jx0unJpYV0tGAEJqaSXRZuMZwGJ9+bDzb1unxtIoe czRg== MIME-Version: 1.0 Received: by 10.112.47.225 with SMTP id g1mr1513293lbn.52.1331758063813; Wed, 14 Mar 2012 13:47:43 -0700 (PDT) Received: by 10.152.127.68 with HTTP; Wed, 14 Mar 2012 13:47:43 -0700 (PDT) In-Reply-To: <012912E5-1FDA-4CBA-9EBD-5224B04A3A78@eformations.net> References: <012912E5-1FDA-4CBA-9EBD-5224B04A3A78@eformations.net> Date: Wed, 14 Mar 2012 21:47:43 +0100 Message-ID: To: Osama Abu Elsorour Cc: internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] [PATCH] readline extension rl_bind_key addition and other enhancements From: nikita.ppv@googlemail.com (Nikita Popov) On Tue, Mar 13, 2012 at 10:46 AM, Osama Abu Elsorour wrote: > [snip] > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 zval *_temp_callback =3D NULL; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 MAKE_STD_ZVAL(_temp_callback); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 *_temp_callback =3D *arg; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 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