diff --git a/qpsmtpd-forkserver b/qpsmtpd-forkserver index 89538a1..282a3cd 100755 --- a/qpsmtpd-forkserver +++ b/qpsmtpd-forkserver @@ -114,7 +114,11 @@ while (1) { my ($port, $iaddr) = sockaddr_in($hisaddr); if ($MAXCONNIP) { my $num_conn = 0; - foreach my $rip (values %childstatus) { + # If we for-loop directly over values %childstatus, a SIGCHLD can call + # REAPER and slip $rip out from under us. Causes "Use of freed value in + # iteration" under perl 5.8.4. + my @rip = values %childstatus; + foreach my $rip (@rip) { if ($rip eq $iaddr) { ++$num_conn; }