Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
--TEST-- Bug #79199 (curl_copy_handle() memory leak) --EXTENSIONS-- curl --FILE-- <?php $m..
Decoded Output download
--TEST--
Bug #79199 (curl_copy_handle() memory leak)
--EXTENSIONS--
curl
--FILE--
<?php
$mem_old = 0;
for($i = 0; $i < 50; ++$i) {
$c1 = curl_init();
$c2 = curl_copy_handle($c1);
curl_close($c2);
curl_close($c1);
$mem_new = memory_get_usage();
if ($mem_new <= $mem_old) {
break;
}
$mem_old = $mem_new;
}
echo $i < 50 ? "okay" : "leak", PHP_EOL;
?>
--EXPECT--
okay
Did this file decode correctly?
Original Code
--TEST--
Bug #79199 (curl_copy_handle() memory leak)
--EXTENSIONS--
curl
--FILE--
<?php
$mem_old = 0;
for($i = 0; $i < 50; ++$i) {
$c1 = curl_init();
$c2 = curl_copy_handle($c1);
curl_close($c2);
curl_close($c1);
$mem_new = memory_get_usage();
if ($mem_new <= $mem_old) {
break;
}
$mem_old = $mem_new;
}
echo $i < 50 ? "okay" : "leak", PHP_EOL;
?>
--EXPECT--
okay
Function Calls
curl_init | 1 |
Stats
MD5 | 555b47683cc14bc7bca10b00b60082a5 |
Eval Count | 0 |
Decode Time | 75 ms |