diff --git a/ext/dom/xpath_callbacks.c b/ext/dom/xpath_callbacks.c index 0974db475b3a..816c925435ae 100644 --- a/ext/dom/xpath_callbacks.c +++ b/ext/dom/xpath_callbacks.c @@ -430,15 +430,12 @@ static zend_result php_dom_xpath_callback_dispatch(php_dom_xpath_callbacks *xpat if (Z_TYPE(callback_retval) != IS_UNDEF) { if (Z_TYPE(callback_retval) == IS_OBJECT && (instanceof_function(Z_OBJCE(callback_retval), dom_get_node_ce(php_dom_follow_spec_node((const xmlNode *) ctxt->context->doc))))) { - xmlNode *nodep; - dom_object *obj; if (xpath_callbacks->node_list == NULL) { xpath_callbacks->node_list = zend_new_array(0); } - Z_ADDREF_P(&callback_retval); zend_hash_next_index_insert_new(xpath_callbacks->node_list, &callback_retval); - obj = Z_DOMOBJ_P(&callback_retval); - nodep = dom_object_get_node(obj); + dom_object *obj = Z_DOMOBJ_P(&callback_retval); + xmlNodePtr nodep = dom_object_get_node(obj); valuePush(ctxt, xmlXPathNewNodeSet(nodep)); } else if (Z_TYPE(callback_retval) == IS_FALSE || Z_TYPE(callback_retval) == IS_TRUE) { valuePush(ctxt, xmlXPathNewBoolean(Z_TYPE(callback_retval) == IS_TRUE)); @@ -447,12 +444,10 @@ static zend_result php_dom_xpath_callback_dispatch(php_dom_xpath_callbacks *xpat zval_ptr_dtor(&callback_retval); return FAILURE; } else { - zend_string *tmp_str; - zend_string *str = zval_get_tmp_string(&callback_retval, &tmp_str); - valuePush(ctxt, xmlXPathNewString(BAD_CAST ZSTR_VAL(str))); - zend_tmp_string_release(tmp_str); + convert_to_string(&callback_retval); + valuePush(ctxt, xmlXPathNewString(BAD_CAST Z_STRVAL(callback_retval))); + zval_ptr_dtor_str(&callback_retval); } - zval_ptr_dtor(&callback_retval); } return SUCCESS; diff --git a/ext/soap/php_http.c b/ext/soap/php_http.c index 4bf599234f78..bac21d26b358 100644 --- a/ext/soap/php_http.c +++ b/ext/soap/php_http.c @@ -1168,18 +1168,12 @@ int make_http_soap_request( char *t = ZSTR_VAL(new_uri->path); char *p = strrchr(t, '/'); if (p) { - zend_string *s = zend_string_alloc((p - t) + ZSTR_LEN(new_uri->path) + 2, 0); - strncpy(ZSTR_VAL(s), t, (p - t) + 1); - ZSTR_VAL(s)[(p - t) + 1] = 0; - strcat(ZSTR_VAL(s), ZSTR_VAL(new_uri->path)); + zend_string *s = zend_string_concat2(t, (p - t) + 1, ZSTR_VAL(new_uri->path), ZSTR_LEN(new_uri->path)); zend_string_release_ex(new_uri->path, 0); new_uri->path = s; } } else { - zend_string *s = zend_string_alloc(ZSTR_LEN(new_uri->path) + 2, 0); - ZSTR_VAL(s)[0] = '/'; - ZSTR_VAL(s)[1] = 0; - strcat(ZSTR_VAL(s), ZSTR_VAL(new_uri->path)); + zend_string *s = zend_string_concat2("/", 1, ZSTR_VAL(new_uri->path), ZSTR_LEN(new_uri->path)); zend_string_release_ex(new_uri->path, 0); new_uri->path = s; } diff --git a/ext/soap/php_sdl.c b/ext/soap/php_sdl.c index e6871cd6e9b3..ad37867dd460 100644 --- a/ext/soap/php_sdl.c +++ b/ext/soap/php_sdl.c @@ -2433,7 +2433,6 @@ static HashTable* make_persistent_sdl_function_headers(HashTable *headers, HashT ZEND_HASH_MAP_FOREACH_STR_KEY_PTR(headers, key, tmp) { pheader = malloc(sizeof(sdlSoapBindingFunctionHeader)); - memset(pheader, 0, sizeof(sdlSoapBindingFunctionHeader)); *pheader = *tmp; if (pheader->name) { @@ -2497,7 +2496,6 @@ static HashTable* make_persistent_sdl_parameters(HashTable *params, HashTable *p ZEND_HASH_FOREACH_STR_KEY_PTR(params, key, tmp) { pparam = malloc(sizeof(sdlParam)); - memset(pparam, 0, sizeof(sdlParam)); *pparam = *tmp; if (pparam->paramName) { @@ -2539,7 +2537,6 @@ static HashTable* make_persistent_sdl_function_faults(sdlFunctionPtr func, HashT ZEND_HASH_MAP_FOREACH_STR_KEY_PTR(faults, key, tmp) { pfault = malloc(sizeof(sdlFault)); - memset(pfault, 0, sizeof(sdlFault)); *pfault = *tmp; if (pfault->name) {