From: Stefan Esser Date: Fri, 21 Jun 2002 14:47:59 +0000 (+0000) Subject: Fixing the same possible memory leak. X-Git-Tag: php-4.3.0dev_zend2_alpha2~165 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=44a5b43b79bb407002b82156ecb4995e20c349fd;p=php Fixing the same possible memory leak. --- diff --git a/sapi/apache/mod_php4.c b/sapi/apache/mod_php4.c index 690a7c3c8d..3aaa6bafb9 100644 --- a/sapi/apache/mod_php4.c +++ b/sapi/apache/mod_php4.c @@ -163,6 +163,7 @@ int sapi_apache_header_handler(sapi_header_struct *sapi_header, sapi_headers_str header_content = p = strchr(header_name, ':'); if (!p) { + efree(sapi_header->header); return 0; } diff --git a/sapi/apache2filter/sapi_apache2.c b/sapi/apache2filter/sapi_apache2.c index d1253302e9..cb3b8d3701 100644 --- a/sapi/apache2filter/sapi_apache2.c +++ b/sapi/apache2filter/sapi_apache2.c @@ -94,7 +94,10 @@ php_apache_sapi_header_handler(sapi_header_struct *sapi_header, sapi_headers_str val = strchr(sapi_header->header, ':'); - if (!val) return 0; + if (!val) { + sapi_free_header(sapi_header); + return 0; + } *val = '\0'; diff --git a/sapi/nsapi/nsapi.c b/sapi/nsapi/nsapi.c index d2c3b2db86..2a392ac434 100644 --- a/sapi/nsapi/nsapi.c +++ b/sapi/nsapi/nsapi.c @@ -156,6 +156,7 @@ sapi_nsapi_header_handler(sapi_header_struct *sapi_header, sapi_headers_struct * header_name = sapi_header->header; header_content = p = strchr(header_name, ':'); if (p == NULL) { + efree(sapi_header->header); return 0; }