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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Tue May 13 12:01:27 2025 UTC