diff options
author | Ilia Alshanetsky <iliaa@php.net> | 2004-05-23 17:22:21 +0000 |
---|---|---|
committer | Ilia Alshanetsky <iliaa@php.net> | 2004-05-23 17:22:21 +0000 |
commit | e4c5e85697882b41aec6f1a29f26c5110da58275 (patch) | |
tree | 429507dd7ea2d628a6df5ce88878b86423b3967d | |
parent | bd892a164b2db7442a84a5612a552e8b894bf0b3 (diff) | |
download | php-git-e4c5e85697882b41aec6f1a29f26c5110da58275.tar.gz |
Fixed leaks on fatal errors in tidy.
-rw-r--r-- | ext/tidy/tidy.c | 8 |
1 files changed, 8 insertions, 0 deletions
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"); } |