mirror of
https://github.com/php/php-src.git
synced 2026-04-10 17:43:13 +02:00
- Add missing test
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
--TEST--
|
||||
Bug #45161 (Reusing a curl handle leaks memory)
|
||||
--SKIPIF--
|
||||
<?php $curl_version = curl_version(); if ($curl_version['version_number'] < 0x071100) die("skip: test works only with curl >= 7.17.0"); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
|
||||
27
ext/curl/tests/bug46711.phpt
Normal file
27
ext/curl/tests/bug46711.phpt
Normal file
@@ -0,0 +1,27 @@
|
||||
--TEST--
|
||||
Bug #46711 (lost memory when foreach is used for values passed to curl_setopt())
|
||||
--FILE--
|
||||
<?php
|
||||
$ch = curl_init();
|
||||
|
||||
$opt = array(
|
||||
CURLOPT_AUTOREFERER => TRUE,
|
||||
CURLOPT_BINARYTRANSFER => TRUE
|
||||
);
|
||||
|
||||
curl_setopt( $ch, CURLOPT_AUTOREFERER , TRUE );
|
||||
|
||||
foreach( $opt as $option => $value ) {
|
||||
curl_setopt( $ch, $option, $value );
|
||||
}
|
||||
|
||||
var_dump($opt); // with this bug, $opt[58] becomes NULL
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
array(2) {
|
||||
[58]=>
|
||||
bool(true)
|
||||
[19914]=>
|
||||
bool(true)
|
||||
}
|
||||
Reference in New Issue
Block a user