php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #61087
Patch parse_ini_file_memleak.patch revision 2012-02-23 17:32 UTC by nikic@php.net
revision 2012-02-14 18:00 UTC by nikic@php.net

Patch parse_ini_file_memleak.patch for *General Issues Bug #61087

Patch version 2012-02-14 18:00 UTC

Return to Bug #61087 | Download this patch
This 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;
 	}
 
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Nov 23 11:01:28 2024 UTC