XML-RPC: Explicitly unset the reference to the parser resource after calling xml_parser_free() to avoid memory leaks in PHP 7.0.0 or higher.

Props procifer, ayeshrajans.
Fixes #49700.

git-svn-id: https://develop.svn.wordpress.org/trunk@48322 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov
2020-07-05 15:20:16 +00:00
parent e3df130089
commit b5b613f8bb
5 changed files with 12 additions and 0 deletions

View File

@@ -564,6 +564,7 @@ function prep_atom_text_construct( $data ) {
xml_parse( $parser, '<div>' . $data . '</div>', true );
$code = xml_get_error_code( $parser );
xml_parser_free( $parser );
unset( $parser );
if ( ! $code ) {
if ( strpos( $data, '<' ) === false ) {