diff --git a/regress/Makefile b/regress/Makefile index 7910b3d..77507ab 100644 --- a/regress/Makefile +++ b/regress/Makefile @@ -34,7 +34,8 @@ PERLPATH = ${.CURDIR}/ .for a in ${ARGS} run-$a: $a - time SUDO=${SUDO} KTRACE=${KTRACE} PFRESOLVED=${PFRESOLVED} \ + time SUDO=${SUDO} MALLOC_OPTIONS=${MALLOC_OPTIONS} KTRACE=${KTRACE} \ + PFRESOLVED=${PFRESOLVED} \ perl ${PERLINC} ${PERLPATH}pfresolved.pl ${PERLPATH}$a .endfor diff --git a/regress/Pfresolved.pm b/regress/Pfresolved.pm index a76e484..8cedd8d 100644 --- a/regress/Pfresolved.pm +++ b/regress/Pfresolved.pm @@ -66,6 +66,11 @@ sub child { } print STDERR "pfresolved not running\n"; + my @env; + if ($ENV{MALLOC_OPTIONS}) { + @env = "env" if $ENV{SUDO}; + push @env, "MALLOC_OPTIONS=$ENV{MALLOC_OPTIONS}"; + } my @ktrace; @ktrace = ($self->{ktraceexec}, "-i", "-f", $self->{ktracefile}) if $self->{ktraceexec}; @@ -74,7 +79,7 @@ sub child { $resolver .= '@'.$self->{port} if $self->{port}; my $hostname = $self->{hostname} || "localhost"; $resolver .= "#$hostname" if $self->{tls}; - my @cmd = (@sudo, @ktrace, $self->{execfile}, "-dvvv", + my @cmd = (@sudo, @env, @ktrace, $self->{execfile}, "-dvvv", "-f", $self->{conffile}); push @cmd, "-r", $resolver if $resolver; push @cmd, "-m", $self->{min_ttl} if $self->{min_ttl};