From: Antony Dovgal Date: Mon, 29 May 2006 20:26:12 +0000 (+0000) Subject: return NULL in case of error (and fix leak/non-null-terminated string error) X-Git-Tag: BEFORE_NEW_OUTPUT_API~44 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d5462c527ab7e0f536f9ea05a27774bc3b2fddc4;p=php return NULL in case of error (and fix leak/non-null-terminated string error) --- diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c index 0504da6362..84cfc0ac91 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; }