]> Sergey Matveev's repositories - public-inbox.git/commitdiff
feed: close string ref before returning
authorEric Wong <e@80x24.org>
Sun, 20 Apr 2014 19:31:23 +0000 (19:31 +0000)
committerEric Wong <e@80x24.org>
Sun, 20 Apr 2014 19:31:23 +0000 (19:31 +0000)
Just in case there is an error, this should be more explicit.

lib/PublicInbox/Feed.pm

index 81ac66b9439c66fd3a059ffdaf718c7d15b090bf..54feaf5b0f98a52d5d25acc2eafc806cd9b11d1b 100644 (file)
@@ -327,8 +327,8 @@ sub do_cat_mail {
                                die "failed to setup string handle: $!\n";
                binmode $fh;
                my $bytes = $git->cat_blob($sha1, $fh);
-               return if $bytes <= 0;
                close $fh or die "failed to close string handle: $!\n";
+               return if $bytes <= 0;
        } else {
                $str = `git cat-file blob $sha1`;
                return if $? != 0 || length($str) == 0;