| 
        php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
 Patch parse_ini_file_memleak.patch for *General Issues Bug #61087Patch version 2012-02-14 18:00 UTC Return to Bug #61087 | Download this patchThis patch is obsolete Obsoleted by patches: Patch Revisions:Developer: nikic@php.net
diff --git a/Zend/zend_ini_scanner.c b/Zend/zend_ini_scanner.c
index 85fc74d..3b4e217 100644
--- a/Zend/zend_ini_scanner.c
+++ b/Zend/zend_ini_scanner.c
@@ -230,9 +230,12 @@ int zend_ini_open_file_for_scanning(zend_file_handle *fh, int scanner_mode TSRML
 	char *buf;
 	size_t size;
 
-	if (zend_stream_fixup(fh, &buf, &size TSRMLS_CC) == FAILURE ||
-		init_ini_scanner(scanner_mode, fh TSRMLS_CC) == FAILURE
-	) {
+	if (zend_stream_fixup(fh, &buf, &size TSRMLS_CC) == FAILURE) {
+		return FAILURE;
+	}
+
+	if (init_ini_scanner(scanner_mode, fh TSRMLS_CC) == FAILURE) {
+		zend_file_handle_dtor(fh TSRMLS_CC);
 		return FAILURE;
 	}
 
         | 
    
            
                 
                Copyright © 2001-2025 The PHP GroupAll rights reserved.  | 
        Last updated: Tue Nov 04 10:00:02 2025 UTC |