From c9f53dedf55b0f8bb6e83525dd0c25cdb7881133 Mon Sep 17 00:00:00 2001 From: William Heimbigner Date: Fri, 25 Dec 2015 00:12:45 +0400 Subject: Fix memory leaks and state corruption introduced by ed53ab7178841862af88f05fafe56a7b8504d527 --- lib/ASM/Event.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/ASM/Event.pm b/lib/ASM/Event.pm index a5f1cc9..470056c 100644 --- a/lib/ASM/Event.pm +++ b/lib/ASM/Event.pm @@ -291,7 +291,7 @@ sub on_part $::log->logg( $event ); $::db->logg( $event ) if defined $::db; # Ignore channels that are +s and not monitored - if (defined $::db and $event->{args}->[0] =~ /^requested by/ and (not ((grep { /^s$/ } @{$::sc{$_}{modes}}) && ($::channels->{channel}->{$_}->{monitor} eq "no"))) ) { + if (defined $::db and $event->{args}->[0] =~ /^requested by/ and (not ((grep { /^s$/ } @{$::sc{$chan}{modes}} ) && ($::channels->{channel}->{$chan}->{monitor} eq "no"))) ) { my $idx = $::db->actionlog( $event); $::log->sqlIncident($chan, $idx) if $idx; } @@ -680,7 +680,7 @@ sub on_mode if ( defined($::db) && (@affected) && (scalar @affected <= 4) ) { foreach my $victim (@affected) { # Ignore channels that are +s and not monitored - if ( not ((grep { /^s$/ } @{$::sc{$_}{modes}}) && ($::channels->{channel}->{$_}->{monitor} eq "no")) ) { + if ( not ((grep { /^s$/ } @{$::sc{$chan}{modes}}) && ($::channels->{channel}->{$chan}->{monitor} eq "no")) ) { my $idx = $::db->actionlog($event, 'ban', $victim); $::log->sqlIncident( $chan, $idx ) if $idx; } @@ -707,7 +707,7 @@ sub on_mode if ( defined($::db) && (@affected) && (scalar @affected <= 4) ) { foreach my $victim (@affected) { # Ignore channels that are +s and not monitored - if ( not ((grep { /^s$/ } @{$::sc{$_}{modes}}) && ($::channels->{channel}->{$_}->{monitor} eq "no")) ) { + if ( not ((grep { /^s$/ } @{$::sc{$chan}{modes}}) && ($::channels->{channel}->{$chan}->{monitor} eq "no")) ) { my $idx = $::db->actionlog($event, 'quiet', $victim); $::log->sqlIncident( $chan, $idx ) if $idx; } -- cgit v1.2.3