From 65a86d7fbf0f07dbbca2d4c5d9d117c28ed38cc7 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 1 May 2014 01:56:34 +0000 Subject: purge Email::Address cache This prevents memory bloat in case we're serving many requests with a large, diverse set of email addresses (potentially from malicious spammers). --- lib/PublicInbox/Feed.pm | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/PublicInbox/Feed.pm') diff --git a/lib/PublicInbox/Feed.pm b/lib/PublicInbox/Feed.pm index d535cea9..6b317ab0 100644 --- a/lib/PublicInbox/Feed.pm +++ b/lib/PublicInbox/Feed.pm @@ -43,6 +43,8 @@ sub generate { my ($add) = @_; add_to_feed($feed_opts, $feed, $add, $git); }); + $git = undef; # destroy pipes + Email::Address->purge_cache; $feed->as_string; } @@ -68,6 +70,7 @@ sub generate_html_index { push @messages, $mime; 1; }); + $git = undef; # destroy pipes. my $th = Mail::Thread->new(@messages); $th->thread; @@ -85,6 +88,8 @@ sub generate_html_index { }); dump_html_line($_, 0, \$html) for $th->rootset; + Email::Address->purge_cache; + my $footer = nav_footer($args->{cgi}, $last); $footer = "
$footer
" if $footer; $html . "$footer"; -- cgit v1.2.3-24-ge0c7