From 8ca3826a2869a013367ba30fcc0b038b693a230b Mon Sep 17 00:00:00 2001 From: Antony Dovgal Date: Mon, 29 May 2006 20:26:32 +0000 Subject: [PATCH] MFH: return NULL in case of error --- ext/pcre/php_pcre.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c index 91d70975fb..76b9822621 100644 --- a/ext/pcre/php_pcre.c +++ b/ext/pcre/php_pcre.c @@ -1115,6 +1115,10 @@ PHPAPI char *php_pcre_replace(char *regex, int regex_len, } } else { pcre_handle_exec_error(count TSRMLS_CC); + if (result) { + efree(result); + result = NULL; + } break; } -- 2.50.1