]> granicus.if.org Git - php/commitdiff
MFH: return NULL in case of error
authorAntony Dovgal <tony2001@php.net>
Mon, 29 May 2006 20:26:32 +0000 (20:26 +0000)
committerAntony Dovgal <tony2001@php.net>
Mon, 29 May 2006 20:26:32 +0000 (20:26 +0000)
ext/pcre/php_pcre.c

index 91d70975fb98180fa42a2912fe0ad4ead0a99664..76b9822621b71a8ada3cc91d590974fe010960cf 100644 (file)
@@ -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;
                }