From: Don Armstrong Date: Sat, 26 Sep 2015 22:58:49 +0000 (-0700) Subject: change the scope of tempdir so that it stays in scope until after display_entity... X-Git-Tag: release/2.6.0~220 X-Git-Url: https://git.donarmstrong.com/?p=debbugs.git;a=commitdiff_plain;h=ddf68e12d5f2988f0bee4ddd5bec46967056a045;hp=d36378ccdad74171fab90161276d5837b4dda874 change the scope of tempdir so that it stays in scope until after display_entity is done --- diff --git a/Debbugs/CGI/Bugreport.pm b/Debbugs/CGI/Bugreport.pm index 6421188..0d7658e 100644 --- a/Debbugs/CGI/Bugreport.pm +++ b/Debbugs/CGI/Bugreport.pm @@ -318,12 +318,13 @@ sub handle_email_message{ my $output; my $output_fh = globify_scalar(\$output); my $entity; + my $tempdir; if (not blessed $email) { my $parser = MIME::Parser->new(); # Because we are using memory, not tempfiles, there's no need to # clean up here like in Debbugs::MIME # this will be cleaned up once it goes out of scope - my $tempdir = File::Temp->newdir(); + $tempdir = File::Temp->newdir(); $parser->output_under($tempdir->dirname()); $entity = $parser->parse_data( $email); } else {