iliaa           Fri Jan  3 12:12:36 2003 EDT

  Modified files:              
    /php4/ext/standard  http_fopen_wrapper.c 
  Log:
  Fixed a memory leak that occurs if the location specified by redirect header
  cannot be opened.
  
  
Index: php4/ext/standard/http_fopen_wrapper.c
diff -u php4/ext/standard/http_fopen_wrapper.c:1.57 
php4/ext/standard/http_fopen_wrapper.c:1.58
--- php4/ext/standard/http_fopen_wrapper.c:1.57 Fri Jan  3 12:05:16 2003
+++ php4/ext/standard/http_fopen_wrapper.c      Fri Jan  3 12:12:35 2003
@@ -18,7 +18,7 @@
    |          Wez Furlong <[EMAIL PROTECTED]>                          |
    +----------------------------------------------------------------------+
  */
-/* $Id: http_fopen_wrapper.c,v 1.57 2003/01/03 17:05:16 iliaa Exp $ */ 
+/* $Id: http_fopen_wrapper.c,v 1.58 2003/01/03 17:12:35 iliaa Exp $ */ 
 
 #include "php.h"
 #include "php_globals.h"
@@ -311,9 +311,9 @@
                                        php_stream_notify_file_size(context, 
file_size, http_header_line, 0);
                                }
 
-                               if (http_header_line[0] == '\0')
+                               if (http_header_line[0] == '\0') {
                                        body = 1;
-                               else    {
+                               } else {
                                        zval *http_header;
 
                                        MAKE_STD_ZVAL(http_header);
@@ -322,9 +322,9 @@
                                
                                        
zend_hash_next_index_insert(Z_ARRVAL_P(response_header), &http_header, sizeof(zval *), 
NULL);
                                }
-                       }
-                       else
+                       } else {
                                break;
+                       }
                }
        } 
        
@@ -379,9 +379,11 @@
                                }
                                zval_dtor(stream->wrapperdata);
                                FREE_ZVAL(stream->wrapperdata);
+                       } else {
+                               zval_dtor(response_header);
+                               FREE_ZVAL(response_header);
                        }
                } else {
-
                        zval_dtor(response_header);
                        FREE_ZVAL(response_header);
 



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

Reply via email to