From: Dmitry Stogov Date: Mon, 31 Jan 2005 14:03:51 +0000 (+0000) Subject: Fixed memory allocation bug. X-Git-Tag: php-5.0.4RC1~222 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e06e987eb498e0c3e727eba207fbabb0b99f4f00;p=php Fixed memory allocation bug. --- diff --git a/ext/soap/soap.c b/ext/soap/soap.c index 81174f605e..43037aedcc 100644 --- a/ext/soap/soap.c +++ b/ext/soap/soap.c @@ -1862,9 +1862,10 @@ static void soap_error_handler(int error_num, const char *error_filename, const char* code = SOAP_GLOBAL(error_code); char buffer[1024]; int buffer_len; - zval outbuf, outbuflen; + zval *outbuf = NULL; + zval outbuflen; - INIT_ZVAL(outbuf); + ALLOC_INIT_ZVAL(outbuf); INIT_ZVAL(outbuflen); buffer_len = vsnprintf(buffer, sizeof(buffer)-1, format, args); @@ -1878,12 +1879,13 @@ static void soap_error_handler(int error_num, const char *error_filename, const } /* Get output buffer and send as fault detials */ if (php_ob_get_length(&outbuflen TSRMLS_CC) != FAILURE && Z_LVAL(outbuflen) != 0) { - php_ob_get_buffer(&outbuf TSRMLS_CC); + ALLOC_INIT_ZVAL(outbuf); + php_ob_get_buffer(outbuf TSRMLS_CC); } php_end_ob_buffer(0, 0 TSRMLS_CC); INIT_ZVAL(fault_obj); - set_soap_fault(&fault_obj, code, buffer, NULL, &outbuf, NULL TSRMLS_CC); + set_soap_fault(&fault_obj, code, buffer, NULL, outbuf, NULL TSRMLS_CC); fault = 1; }