From: Ilia Alshanetsky Date: Sun, 23 May 2004 17:22:21 +0000 (+0000) Subject: Fixed leaks on fatal errors in tidy. X-Git-Tag: php-5.0.0RC3RC1~67 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e4c5e85697882b41aec6f1a29f26c5110da58275;p=php Fixed leaks on fatal errors in tidy. --- diff --git a/ext/tidy/tidy.c b/ext/tidy/tidy.c index 770562d18f..3088af53bd 100644 --- a/ext/tidy/tidy.c +++ b/ext/tidy/tidy.c @@ -403,6 +403,9 @@ static void php_tidy_quick_repair(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_fil tidyBufInit(errbuf); if (tidySetErrorBuffer(doc, errbuf) != 0) { + tidyBufFree(errbuf); + efree(errbuf); + tidyRelease(doc); php_error_docref(NULL TSRMLS_CC, E_ERROR, "Could not set Tidy error buffer"); } @@ -524,6 +527,11 @@ static void tidy_object_new(zend_class_entry *class_type, zend_object_handlers * tidyBufInit(intern->ptdoc->errbuf); if (tidySetErrorBuffer(intern->ptdoc->doc, intern->ptdoc->errbuf) != 0) { + tidyBufFree(intern->ptdoc->errbuf); + efree(intern->ptdoc->errbuf); + tidyRelease(intern->ptdoc->doc); + efree(intern->ptdoc); + efree(intern); php_error_docref(NULL TSRMLS_CC, E_ERROR, "Could not set Tidy error buffer"); }