Skip to content

Commit

Permalink
Use TRY_ADDREF/TRY_DELREF in soap
Browse files Browse the repository at this point in the history
The DELREF part is a possible fix for bug #78278, the ADDREF part
is a drive-by fix.
  • Loading branch information
nikic committed Jul 12, 2019
1 parent 4a91f66 commit a7de2af
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ext/soap/php_encoding.c
Expand Up @@ -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)) {
Expand Down Expand Up @@ -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));
Expand Down

1 comment on commit a7de2af

@loverg-c
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was the author of #78278,
This commit resolve my problem, thanks !

Please sign in to comment.