diff options
Diffstat (limited to 'ext/soap/php_encoding.c')
-rw-r--r-- | ext/soap/php_encoding.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/ext/soap/php_encoding.c b/ext/soap/php_encoding.c index 0eaad5bbec..5ba17eb9fc 100644 --- a/ext/soap/php_encoding.c +++ b/ext/soap/php_encoding.c @@ -452,13 +452,9 @@ static xmlNodePtr to_xml_string(encodeTypePtr type, zval *data, int style) zval_dtor(&tmp); } - pstr = malloc(new_len + 1); - memcpy(pstr, str, new_len); - pstr[new_len] = '\0'; + xmlNodeSetContentLen(ret, str, new_len); efree(str); - xmlNodeSetContentLen(ret, pstr, new_len); - if (style == SOAP_ENCODED) { set_ns_and_type(ret, type); } @@ -1975,10 +1971,7 @@ static xmlNodePtr to_xml_datetime_ex(encodeTypePtr type, zval *data, char *forma xmlNodeSetContent(xmlParam, buf); efree(buf); } else if (Z_TYPE_P(data) == IS_STRING) { - buf = malloc(Z_STRLEN_P(data)+1); - strcpy(buf, Z_STRVAL_P(data)); - - xmlNodeSetContentLen(xmlParam, buf, Z_STRLEN_P(data)); + xmlNodeSetContentLen(xmlParam, Z_STRVAL_P(data), Z_STRLEN_P(data)); } if (style == SOAP_ENCODED) { |