php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #39495 memory leak with php_pcre_match() (PHP 4 only!)
Submitted: 2006-11-13 13:40 UTC Modified: 2008-07-06 17:04 UTC
Votes:5
Avg. Score:4.6 ± 0.5
Reproduced:3 of 3 (100.0%)
Same Version:1 (33.3%)
Same OS:1 (33.3%)
From: rsky0711 at gmail dot com Assigned: andrei (profile)
Status: Wont fix Package: PCRE related
PHP Version: 4.4.4 OS: ALL
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: rsky0711 at gmail dot com
New email:
PHP Version: OS:

 

 [2006-11-13 13:40 UTC] rsky0711 at gmail dot com
Description:
------------
This is a patch. This problem is already fixed in PHP_5_1, 
PHP_5_2 and HEAD branch.
--- php_pcre.c.orig	2006-11-13 21:56:27.000000000 +0900
+++ php_pcre.c	2006-11-13 21:58:42.000000000 +0900
@@ -454,6 +454,8 @@
 		if (rc < 0) {
 			php_error(E_WARNING, "%s: internal pcre_fullinfo
() error %d",
 					  get_active_function_name(TSRMLS_C), 
rc);
+			efree(offsets);
+			efree(subpat_names);
 			RETURN_FALSE;
 		}
 		if (name_cnt > 0) {
@@ -464,6 +466,8 @@
 			if (rc < 0) {
 				php_error(E_WARNING, "%s: internal 
pcre_fullinfo() error %d",
 						  get_active_function_name
(TSRMLS_C), rc);
+				efree(offsets);
+				efree(subpat_names);
 				RETURN_FALSE;
 			}
 



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-07-06 17:04 UTC] nlopess@php.net
PHP 4 is dead. also those lines are never reached in practice.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 08:01:28 2024 UTC