php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login

Patch fix-refcounting for SOAP related Bug #75306

Patch version 2018-11-04 11:04 UTC

Return to Bug #75306 | Download this patch
Patch Revisions:

Developer: cmb@php.net

 ext/soap/php_sdl.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/ext/soap/php_sdl.c b/ext/soap/php_sdl.c
index 2cc46b7387..2f59e25a0e 100644
--- a/ext/soap/php_sdl.c
+++ b/ext/soap/php_sdl.c
@@ -3234,6 +3234,7 @@ sdlPtr get_sdl(zval *this_ptr, char *uri, zend_long cache_wsdl)
 	if (NULL != (tmp = zend_hash_str_find(Z_OBJPROP_P(this_ptr),
 			"_stream_context", sizeof("_stream_context")-1))) {
 		context = php_stream_context_from_zval(tmp, 0);
+		GC_ADDREF(context->res);
 	} else {
 		context = php_stream_context_alloc();
 	}
@@ -3300,7 +3301,7 @@ sdlPtr get_sdl(zval *this_ptr, char *uri, zend_long cache_wsdl)
 	}
 
 	if (context) {
-		php_stream_context_to_zval(context, &new_context);
+		ZVAL_RES(&new_context, (context)->res);
 		php_libxml_switch_context(&new_context, &orig_context);
 	}
 
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 15:01:32 2024 UTC