dmitry          Fri Jul 13 09:14:03 2007 UTC

  Modified files:              (Branch: PHP_5_2)
    /php-src/ext/soap   php_http.c 
  Log:
  Fixed memleak
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/soap/php_http.c?r1=1.77.2.11.2.10&r2=1.77.2.11.2.11&diff_format=u
Index: php-src/ext/soap/php_http.c
diff -u php-src/ext/soap/php_http.c:1.77.2.11.2.10 
php-src/ext/soap/php_http.c:1.77.2.11.2.11
--- php-src/ext/soap/php_http.c:1.77.2.11.2.10  Thu May 10 21:52:10 2007
+++ php-src/ext/soap/php_http.c Fri Jul 13 09:14:03 2007
@@ -17,7 +17,7 @@
   |          Dmitry Stogov <[EMAIL PROTECTED]>                             |
   +----------------------------------------------------------------------+
 */
-/* $Id: php_http.c,v 1.77.2.11.2.10 2007/05/10 21:52:10 tony2001 Exp $ */
+/* $Id: php_http.c,v 1.77.2.11.2.11 2007/07/13 09:14:03 dmitry Exp $ */
 
 #include "php_soap.h"
 #include "ext/standard/base64.h"
@@ -288,6 +288,7 @@
                                request_size = Z_STRLEN(retval);
                        } else {
                                if (request != buf) {efree(request);}
+                               smart_str_free(&soap_headers_z);
                                return FALSE;
                        }
          }
@@ -311,6 +312,7 @@
          if (phpurl != NULL) {php_url_free(phpurl);}
                if (request != buf) {efree(request);}
                add_soap_fault(this_ptr, "HTTP", "Unable to parse URL", NULL, 
NULL TSRMLS_CC);
+               smart_str_free(&soap_headers_z);
                return FALSE;
        }
 
@@ -321,6 +323,7 @@
                php_url_free(phpurl);
                if (request != buf) {efree(request);}
                add_soap_fault(this_ptr, "HTTP", "Unknown protocol. Only http 
and https are allowed.", NULL, NULL TSRMLS_CC);
+               smart_str_free(&soap_headers_z);
                return FALSE;
        }
 
@@ -331,6 +334,7 @@
                if (request != buf) {efree(request);}
                add_soap_fault(this_ptr, "HTTP", "SSL support is not available 
in this build", NULL, NULL TSRMLS_CC);
                PG(allow_url_fopen) = old_allow_url_fopen;
+               smart_str_free(&soap_headers_z);
                return FALSE;
        }
 
@@ -380,6 +384,7 @@
                        if (request != buf) {efree(request);}
                        add_soap_fault(this_ptr, "HTTP", "Could not connect to 
host", NULL, NULL TSRMLS_CC);
                        PG(allow_url_fopen) = old_allow_url_fopen;
+                       smart_str_free(&soap_headers_z);
                        return FALSE;
                }
        }
@@ -438,7 +443,6 @@
                }
 
                smart_str_append(&soap_headers, &soap_headers_z);
-               smart_str_free(&soap_headers_z);
 
                if (soap_version == SOAP_1_2) {
                        smart_str_append_const(&soap_headers,"Content-Type: 
application/soap+xml; charset=utf-8");
@@ -695,6 +699,7 @@
 
        } else {
                add_soap_fault(this_ptr, "HTTP", "Failed to create stream??", 
NULL, NULL TSRMLS_CC);
+               smart_str_free(&soap_headers_z);
                return FALSE;
        }
 
@@ -702,6 +707,7 @@
                php_stream_close(stream);
                zend_hash_del(Z_OBJPROP_P(this_ptr), "httpsocket", 
sizeof("httpsocket"));
                zend_hash_del(Z_OBJPROP_P(this_ptr), "_use_proxy", 
sizeof("_use_proxy"));
+               smart_str_free(&soap_headers_z);
                return TRUE;
        }
 
@@ -713,6 +719,7 @@
                        zend_hash_del(Z_OBJPROP_P(this_ptr), "httpsocket", 
sizeof("httpsocket"));
                        zend_hash_del(Z_OBJPROP_P(this_ptr), "_use_proxy", 
sizeof("_use_proxy"));
                        add_soap_fault(this_ptr, "HTTP", "Error Fetching http 
headers", NULL, NULL TSRMLS_CC);
+                       smart_str_free(&soap_headers_z);
                        return FALSE;
                }
 
@@ -861,6 +868,7 @@
                if (http_msg) {
                        efree(http_msg);
                }
+               smart_str_free(&soap_headers_z);
                return FALSE;
        }
 
@@ -1008,6 +1016,7 @@
                }
                if (auth) efree(auth);
        }
+       smart_str_free(&soap_headers_z);
 
        /* Check and see if the server even sent a xml document */
        content_type = get_http_header_value(http_headers,"Content-Type: ");

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to