Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:37710 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 2932 invoked from network); 18 May 2008 21:03:31 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 May 2008 21:03:31 -0000 Authentication-Results: pb1.pair.com smtp.mail=crrodriguez@suse.de; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=crrodriguez@suse.de; sender-id=unknown Received-SPF: error (pb1.pair.com: domain suse.de from 195.135.220.2 cause and error) X-PHP-List-Original-Sender: crrodriguez@suse.de X-Host-Fingerprint: 195.135.220.2 mail.suse.de Linux 2.4/2.6 Received: from [195.135.220.2] ([195.135.220.2:50548] helo=mx1.suse.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 64/36-57662-0A990384 for ; Sun, 18 May 2008 17:03:29 -0400 Received: from Relay2.suse.de (mail2.suse.de [195.135.221.8]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.suse.de (Postfix) with ESMTP id C48DF41E3F; Sun, 18 May 2008 23:03:25 +0200 (CEST) Message-ID: <48309995.4080409@suse.de> Date: Sun, 18 May 2008 17:03:17 -0400 Organization: Platform/OpenSUSE - Core Services, SUSE LINUX Products GmbH, Research & Development User-Agent: Thunderbird 2.0.0.14 (X11/20080421) MIME-Version: 1.0 To: Rasmus Lerdorf Cc: PHP Developers Mailing List References: <482E8391.9080004@lerdorf.com> In-Reply-To: <482E8391.9080004@lerdorf.com> X-Enigmail-Version: 0.95.6 OpenPGP: id=85898BD3 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig07DBEBCE507BC1477D93C647" Subject: Re: [PHP-DEV] Curl POST emalloc leak? From: crrodriguez@suse.de (=?UTF-8?B?Q3Jpc3RpYW4gUm9kcsOtZ3Vleg==?=) --------------enig07DBEBCE507BC1477D93C647 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Rasmus Lerdorf escribi=C3=B3: > Can someone spot why this code >=20 > (tested in both 5.2.5 and 5.3) >=20 > function curl($post) { > $ch =3D curl_init(); > curl_setopt($ch, CURLOPT_URL, "www.fdhfkdsslak.bogus"); > curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); > if($post) { > curl_setopt($ch, CURLOPT_POST, 1); > for($args=3D'',$i=3D0;$i<75;$i++) $args .=3D "a=3D$i&"; > curl_setopt($ch, CURLOPT_POSTFIELDS, $args); > unset($args); > } > curl_exec($ch); > curl_close($ch); > } > echo "start ".memory_get_usage()."\n"; > for($i=3D0;$i<10;$i++) { > curl(0); > echo "GET ".memory_get_usage()."\n"; > } > for($i=3D0;$i<10;$i++) { > curl(1); > echo "POST ".memory_get_usage()."\n"; > } > ?> >=20 > outputs: for me start 120400 GET 122624 GET 122624 GET 122624 GET 122624 GET 122624 GET 122624 GET 122624 GET 122624 GET 122624 GET 122624 POST 124968 POST 125928 POST 126608 POST 127272 POST 127920 POST 128552 POST 129168 POST 129768 POST 130352 POST 130920 when I request for $real_usage the results are constant.. --=20 "Progress is possible only if we train ourselves to think about programs without thinking of them as pieces of executable code.=E2=80=9D - Edsge= r W.=20 Dijkstra Cristian Rodr=C3=ADguez R. Platform/OpenSUSE - Core Services SUSE LINUX Products GmbH Research & Development http://www.opensuse.org/ --------------enig07DBEBCE507BC1477D93C647 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4-svn0 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org iD8DBQFIMJmYhbiInYWJi9MRAt86AJwLZUMt63E+3o+ciOwJ6uP+UD6yPQCgru/u duVHt12cnlt34I6MlvivUAY= =Q59l -----END PGP SIGNATURE----- --------------enig07DBEBCE507BC1477D93C647--