about summary refs log tree commit homepage
path: root/lib
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2019-06-01 03:27:55 +0000
committerEric Wong <e@80x24.org>2019-06-01 07:38:50 +0000
commitaf00ac5113c1e7acc203a0051d669ad9d1a43b90 (patch)
treea147421d8c265ae583b141118cb1936930deb462 /lib
parente48187f2ca08612e1eb1f987caa9cd5be48be27a (diff)
downloadpublic-inbox-af00ac5113c1e7acc203a0051d669ad9d1a43b90.tar.gz
No reason to leave that (usually) empty file open after killing off
"cat-file --batch-check".  This wasn't an unbound leak, though,
as respawning the --batch-check process would've clobbered the
old err_c file.
Diffstat (limited to 'lib')
-rw-r--r--lib/PublicInbox/Git.pm5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/PublicInbox/Git.pm b/lib/PublicInbox/Git.pm
index 9a38d7c8..9014e021 100644
--- a/lib/PublicInbox/Git.pm
+++ b/lib/PublicInbox/Git.pm
@@ -211,9 +211,10 @@ sub check {
 }
 
 sub _destroy {
-        my ($self, $in, $out, $pid) = @_;
+        my ($self, $in, $out, $pid, $err) = @_;
         my $p = delete $self->{$pid} or return;
         delete @$self{($in, $out)};
+        delete $self->{$err} if $err; # `err_c'
         waitpid $p, 0;
 }
 
@@ -243,7 +244,7 @@ sub qx {
 sub cleanup {
         my ($self) = @_;
         _destroy($self, qw(in out pid));
-        _destroy($self, qw(in_c out_c pid_c));
+        _destroy($self, qw(in_c out_c pid_c err_c));
         !!($self->{pid} || $self->{pid_c});
 }