summaryrefslogtreecommitdiff
path: root/ext/tidy
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2004-05-23 17:22:21 +0000
committerIlia Alshanetsky <iliaa@php.net>2004-05-23 17:22:21 +0000
commite4c5e85697882b41aec6f1a29f26c5110da58275 (patch)
tree429507dd7ea2d628a6df5ce88878b86423b3967d /ext/tidy
parentbd892a164b2db7442a84a5612a552e8b894bf0b3 (diff)
downloadphp-git-e4c5e85697882b41aec6f1a29f26c5110da58275.tar.gz
Fixed leaks on fatal errors in tidy.
Diffstat (limited to 'ext/tidy')
-rw-r--r--ext/tidy/tidy.c8
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");
}