diff options
author | Dylan William Hardison <dylan@hardison.net> | 2017-02-06 16:46:36 +0100 |
---|---|---|
committer | Dylan William Hardison <dylan@hardison.net> | 2017-02-06 16:46:36 +0100 |
commit | 92ca9f67a4a2306218491ac45607a33414b96ad9 (patch) | |
tree | 0714b0c90f6256546bda0b8693e051571e5e8bc0 /extensions | |
parent | dc479382176a0638fb978149e91c258ec9af6c28 (diff) | |
download | bugzilla-92ca9f67a4a2306218491ac45607a33414b96ad9.tar.gz bugzilla-92ca9f67a4a2306218491ac45607a33414b96ad9.tar.xz |
Bug 1336958 - Call delete on HTML::Tree objects to avoid leaking memory
Diffstat (limited to 'extensions')
-rw-r--r-- | extensions/Profanivore/Extension.pm | 6 | ||||
-rw-r--r-- | extensions/SecureMail/Extension.pm | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/extensions/Profanivore/Extension.pm b/extensions/Profanivore/Extension.pm index 76d30e982..9584ee695 100644 --- a/extensions/Profanivore/Extension.pm +++ b/extensions/Profanivore/Extension.pm @@ -161,7 +161,11 @@ sub _filter_html { foreach my $comment (@comments) { _filter_html_node($comment, \$dirty); } - return $dirty ? $tree->as_HTML : $html; + if ($dirty) { + $html = $tree->as_HTML; + $tree->delete; + } + return $html; } sub _filter_html_node { diff --git a/extensions/SecureMail/Extension.pm b/extensions/SecureMail/Extension.pm index e62938dc7..d3dc023f6 100644 --- a/extensions/SecureMail/Extension.pm +++ b/extensions/SecureMail/Extension.pm @@ -646,6 +646,7 @@ sub _insert_subject { my $body = $tree->look_down(qw(_tag body)); $body->unshift_content(['h1', "Subject: $subject"], ['br']); $part->body_str_set($tree->as_HTML); + $tree->delete; } } @@ -696,6 +697,7 @@ sub _filter_bug_links { if ($updated) { $part->body_str_set($tree->as_HTML); } + $tree->delete; }); } |