From c6da8610dc61306b797f4d831975bf1c6fb7c04d Mon Sep 17 00:00:00 2001 From: Jared Johnson Date: Mon, 15 Sep 2014 15:34:58 -0500 Subject: [PATCH] Fix crasher Add missing 'use' and use get/set method for cleaner storage of QP object --- lib/Qpsmtpd.pm | 3 ++- lib/Qpsmtpd/Address.pm | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/Qpsmtpd.pm b/lib/Qpsmtpd.pm index f73bac4..4b9ce65 100644 --- a/lib/Qpsmtpd.pm +++ b/lib/Qpsmtpd.pm @@ -5,6 +5,7 @@ use vars qw($TraceLevel $Spool_dir $Size_threshold); use Sys::Hostname; use Qpsmtpd::Constants; +use Qpsmtpd::Address; our $VERSION = "0.94"; @@ -651,7 +652,7 @@ sub auth_mechanism { sub address { my $self = shift; my $addr = Qpsmtpd::Address->new(@_); - $addr->{qp} = $self; + $addr->qp($self); return $addr; } diff --git a/lib/Qpsmtpd/Address.pm b/lib/Qpsmtpd/Address.pm index fc0c810..35ac4f6 100644 --- a/lib/Qpsmtpd/Address.pm +++ b/lib/Qpsmtpd/Address.pm @@ -346,7 +346,8 @@ hook_user_config =cut sub qp { - my ($self) = @_; + my $self = shift; + $self->{qp} = $_[0] if @_; return $self->{qp}; }