Skip to content

Commit

Permalink
Fix bug #61264: xmlrpc_parse_method_descriptions leaks temporary vari…
Browse files Browse the repository at this point in the history
…able
  • Loading branch information
nikic committed Mar 3, 2012
1 parent 37d7df7 commit 3e7792a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
1 change: 1 addition & 0 deletions NEWS
Expand Up @@ -73,6 +73,7 @@ PHP NEWS

- XMLRPC:
. Fixed bug #61097 (Memory leak in xmlrpc functions copying zvals). (Nikic)
. Fixed bug #61264 (xmlrpc_parse_method_descriptions leaks temporary variable). (Nikita Popov)

- Zlib:
. Fixed bug #61139 (gzopen leaks when specifying invalid mode). (Nikic)
Expand Down
17 changes: 17 additions & 0 deletions ext/xmlrpc/tests/bug61264.phpt
@@ -0,0 +1,17 @@
--TEST--
Bug #61264: xmlrpc_parse_method_descriptions leaks temporary variable
--FILE--
<?php
$xml = <<<XML
<?xml version="1.0" encoding="utf-8"?>
<a>
<b>foo</b>
</a>
XML;
var_dump(xmlrpc_parse_method_descriptions($xml));
?>
--EXPECT--
array(1) {
["b"]=>
string(3) "foo"
}
3 changes: 1 addition & 2 deletions ext/xmlrpc/xmlrpc-epi-php.c
Expand Up @@ -1240,8 +1240,7 @@ PHP_FUNCTION(xmlrpc_parse_method_descriptions)
retval = XMLRPC_to_PHP(xVal);

if (retval) {
*return_value = *retval;
zval_copy_ctor(return_value);
RETVAL_ZVAL(retval, 1, 1);
}
/* dust, sweep, and mop */
XMLRPC_CleanupValue(xVal);
Expand Down

0 comments on commit 3e7792a

Please sign in to comment.