cvs: php-src(PHP_5_0) /ext/soap soap.c
| From: | Dmitry Stogov | Date: | Thu, 26 Aug 2004 18:55:54 +0000 |
| Subject: | cvs: php-src(PHP_5_0) /ext/soap soap.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-28472@lists.php.net to get a copy of this message | ||
dmitry Thu Aug 26 14:55:54 2004 EDT
Modified files: (Branch: PHP_5_0)
/php-src/ext/soap soap.c
Log:
Memory leaks were fixed.
http://cvs.php.net/diff.php/php-src/ext/soap/soap.c?r1=1.110.2.3&r2=1.110.2.4&ty=u
Index: php-src/ext/soap/soap.c
diff -u php-src/ext/soap/soap.c:1.110.2.3 php-src/ext/soap/soap.c:1.110.2.4
--- php-src/ext/soap/soap.c:1.110.2.3 Thu Aug 26 08:20:13 2004
+++ php-src/ext/soap/soap.c Thu Aug 26 14:55:54 2004
@@ -17,7 +17,7 @@
| Dmitry Stogov <dmitry@zend.com> |
+----------------------------------------------------------------------+
*/
-/* $Id: soap.c,v 1.110.2.3 2004/08/26 12:20:13 dmitry Exp $ */
+/* $Id: soap.c,v 1.110.2.4 2004/08/26 18:55:54 dmitry Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -394,6 +394,7 @@
zend_hash_add(&soap_globals->defEncNs, XSD_1999_NAMESPACE, sizeof(XSD_1999_NAMESPACE),
XSD_NS_PREFIX, sizeof(XSD_NS_PREFIX), NULL);
zend_hash_add(&soap_globals->defEncNs, XSD_NAMESPACE, sizeof(XSD_NAMESPACE), XSD_NS_PREFIX,
sizeof(XSD_NS_PREFIX), NULL);
zend_hash_add(&soap_globals->defEncNs, XSI_NAMESPACE, sizeof(XSI_NAMESPACE), XSI_NS_PREFIX,
sizeof(XSI_NS_PREFIX), NULL);
+ zend_hash_add(&soap_globals->defEncNs, XML_NAMESPACE, sizeof(XML_NAMESPACE), XML_NS_PREFIX,
sizeof(XML_NS_PREFIX), NULL);
zend_hash_add(&soap_globals->defEncNs, SOAP_1_1_ENC_NAMESPACE,
sizeof(SOAP_1_1_ENC_NAMESPACE), SOAP_1_1_ENC_NS_PREFIX, sizeof(SOAP_1_1_ENC_NS_PREFIX), NULL);
zend_hash_add(&soap_globals->defEncNs, SOAP_1_2_ENC_NAMESPACE,
sizeof(SOAP_1_2_ENC_NAMESPACE), SOAP_1_2_ENC_NS_PREFIX, sizeof(SOAP_1_2_ENC_NS_PREFIX), NULL);
@@ -2227,7 +2228,7 @@
zval *headers = NULL;
zval *output_headers = NULL;
zval *args;
- zval **real_args;
+ zval **real_args = NULL;
zval **param;
int arg_count;
@@ -2282,18 +2283,22 @@
arg_count = zend_hash_num_elements(Z_ARRVAL_P(args));
- real_args = safe_emalloc(sizeof(zval *), arg_count, 0);
- for (zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(args), &pos);
- zend_hash_get_current_data_ex(Z_ARRVAL_P(args), (void **) ¶m, &pos) == SUCCESS;
- zend_hash_move_forward_ex(Z_ARRVAL_P(args), &pos)) {
- /*zval_add_ref(param);*/
- real_args[i++] = *param;
+ if (arg_count > 0) {
+ real_args = safe_emalloc(sizeof(zval *), arg_count, 0);
+ for (zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(args), &pos);
+ zend_hash_get_current_data_ex(Z_ARRVAL_P(args), (void **) ¶m, &pos) == SUCCESS;
+ zend_hash_move_forward_ex(Z_ARRVAL_P(args), &pos)) {
+ /*zval_add_ref(param);*/
+ real_args[i++] = *param;
+ }
}
if (output_headers) {
array_init(output_headers);
}
do_soap_call(this_ptr, function, function_len, arg_count, real_args, return_value, soap_action,
uri, soap_headers, output_headers TSRMLS_CC);
- efree(real_args);
+ if (arg_count > 0) {
+ efree(real_args);
+ }
if (soap_headers && ! headers) {
zend_hash_destroy(soap_headers);