When REAPER is called by SIGCHLD, it can start in the middle of the loop
over values %childstatus in the MAXCONNIP block. This can cause $rip to be deleted by REAPER while we're using it. Perl will die saying "Use of freed value in iteration". -- brian@SoftHome.net git-svn-id: https://svn.perl.org/qpsmtpd/trunk@286 958fd67b-6ff1-0310-b445-bb7760255be9
This commit is contained in:
parent
cbb7b5dba3
commit
dae911cec8
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user