From a7de2af46ccff1207a7008602b079b92de57a9fe Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Fri, 12 Jul 2019 16:50:43 +0200 Subject: [PATCH] Use TRY_ADDREF/TRY_DELREF in soap The DELREF part is a possible fix for bug #78278, the ADDREF part is a drive-by fix. --- ext/soap/php_encoding.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/soap/php_encoding.c b/ext/soap/php_encoding.c index 2afb31d7798..c29e9670918 100644 --- a/ext/soap/php_encoding.c +++ b/ext/soap/php_encoding.c @@ -2269,7 +2269,7 @@ static xmlNodePtr to_xml_array(encodeTypePtr type, zval *data, int style, xmlNod } else { add_next_index_zval(&array_copy, val); } - Z_ADDREF_P(val); + Z_TRY_ADDREF_P(val); iter->funcs->move_forward(iter); if (EG(exception)) { @@ -2850,7 +2850,7 @@ static zval *guess_zval_convert(zval *ret, encodeTypePtr type, xmlNodePtr data) object_init_ex(&soapvar, soap_var_class_entry); add_property_long(&soapvar, "enc_type", enc->details.type); - Z_DELREF_P(ret); + Z_TRY_DELREF_P(ret); add_property_zval(&soapvar, "enc_value", ret); parse_namespace(type_name, &cptype, &ns); nsptr = xmlSearchNs(data->doc, data, BAD_CAST(ns));