]> git.donarmstrong.com Git - debbugs.git/commitdiff
change the scope of tempdir so that it stays in scope until after display_entity...
authorDon Armstrong <don@donarmstrong.com>
Sat, 26 Sep 2015 22:58:49 +0000 (15:58 -0700)
committerDon Armstrong <don@donarmstrong.com>
Sat, 26 Sep 2015 22:58:49 +0000 (15:58 -0700)
Debbugs/CGI/Bugreport.pm

index 64211884e1ac47d1e41961d267361801be82d9eb..0d7658e574f9ee8369c0bbc07c133e0795512563 100644 (file)
@@ -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 {