|
|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2016-09-01 04:11 UTC] laruence@php.net
[2016-09-01 04:11 UTC] laruence@php.net
-Status: Open
+Status: Closed
[2016-10-03 09:34 UTC] aaron at serendipity dot cx
[2016-10-03 09:40 UTC] aaron at serendipity dot cx
[2016-10-17 10:08 UTC] bwoebi@php.net
|
|||||||||||||||||||||||||||
|
All rights reserved. |
Last updated: Thu Nov 06 18:00:01 2025 UTC |
Description: ------------ Description =========== Due to the zend_accel_blacklist_update_regexp() function not releasing/freeing memory allocated on the heap, a memory leak can occur. This relates to the *it pointer. Code Snippet ============ static void zend_accel_blacklist_update_regexp(zend_blacklist *blacklist) { const char *pcre_error; int i, pcre_error_offset; zend_regexp_list **regexp_list_it, *it; char regexp[12*1024], *p, *end, *c, *backtrack = NULL; ----------SNIP--------- it = (zend_regexp_list*)malloc(sizeof(zend_regexp_list)); if (!it) { zend_accel_error(ACCEL_LOG_ERROR, "malloc() failed\n"); return; } it->next = NULL; if ((it->re = pcre_compile(regexp, PCRE_NO_AUTO_CAPTURE, &pcre_error, &pcre_error_offset, 0)) == NULL) { blacklist_report_regexp_error(pcre_error, pcre_error_offset); } /* prepare for the next iteration */ p = regexp + 2; *regexp_list_it = it; regexp_list_it = &it->next; ----------SNIP--------- Expected result: ---------------- An expected result it that the *it pointer is free'd after finish of use, as opposed to using up unnecessary system resources. Actual result: -------------- A memory leak occurs.