From: Yasuo Ohgaki Date: Mon, 11 Mar 2002 07:11:54 +0000 (+0000) Subject: Small memory leak fix that does not matter much. X-Git-Tag: help~93 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7bccaefc418212641098556c817117a5687acdb2;p=php Small memory leak fix that does not matter much. --- diff --git a/ext/ereg/ereg.c b/ext/ereg/ereg.c index 6fff6a5352..02e39e401f 100644 --- a/ext/ereg/ereg.c +++ b/ext/ereg/ereg.c @@ -220,6 +220,7 @@ static void php_ereg(INTERNAL_FUNCTION_PARAMETERS, int icase) buf = emalloc(string_len); if (!buf) { php_error(E_WARNING, "Unable to allocate memory in php_ereg"); + regfree(&re); efree(subs); RETURN_FALSE; } diff --git a/ext/standard/reg.c b/ext/standard/reg.c index 6fff6a5352..02e39e401f 100644 --- a/ext/standard/reg.c +++ b/ext/standard/reg.c @@ -220,6 +220,7 @@ static void php_ereg(INTERNAL_FUNCTION_PARAMETERS, int icase) buf = emalloc(string_len); if (!buf) { php_error(E_WARNING, "Unable to allocate memory in php_ereg"); + regfree(&re); efree(subs); RETURN_FALSE; }