]> granicus.if.org Git - php/commitdiff
fix leak
authorAntony Dovgal <tony2001@php.net>
Tue, 3 Oct 2006 21:17:29 +0000 (21:17 +0000)
committerAntony Dovgal <tony2001@php.net>
Tue, 3 Oct 2006 21:17:29 +0000 (21:17 +0000)
ext/pcre/php_pcre.c

index c8a6831e74b9852b66df75c1d98497d251ffcbf6..1ae9d55162db03f9be2a3372c260f8823abcfb3b 100644 (file)
@@ -1861,6 +1861,9 @@ PHPAPI void  php_pcre_grep_impl(pcre_cache_entry *pce, zval *input, zval *return
                        php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Matched, but too many substrings");
                        count = size_offsets/3;
                } else if (count < 0 && count != PCRE_ERROR_NOMATCH) {
+                       if (Z_TYPE_PP(entry) != IS_STRING) {
+                               zval_dtor(&subject);
+                       }
                        pcre_handle_exec_error(count TSRMLS_CC);
                        break;
                }