Use of freed value in iteration

  • Thread starter Stuart Kendrick
  • Start date
S

Stuart Kendrick

hi folks,

i don't understand why Perl bombs with 'Use of freed value in
iteration' in my code below... i don't see where i'm modifying the
contents of %esx in my loop. can anyone see what i'm missing?

guru> cat test
#!/opt/local/bin/perl

use strict;
use warnings;
use SNMP;

my $obj = "sysDescr";
my $read = "public";
my ($sess, $val, $vb);

my %esx = ( "10.10.22.8" => "b2-esx",
"10.10.16.8" => "a1-esx",
"10.10.18.8" => "a2-esx",
"10.10.20.8" => "a3-esx",
);

for my $addr (keys %esx) {
print "Processing $addr\n";
$sess = new SNMP::Session ( Community => $read,
DestHost => $addr,
);
$vb = new SNMP::Varbind([$obj]);
$val = $sess->bulkwalk('0', '10000', $vb);
print "Finished $addr\n";
}

guru> ./test
Processing 10.10.18.8
Finished 10.10.18.8
Processing 10.10.22.8
Finished 10.10.22.8
Use of freed value in iteration at ./test line 24.
guru>

Notes:

-line 24 is the 'print "Finished $addr\n";' line.

-naturally, im my real code, i'm not performing snmpbulkwalks on
sysDescr ... but this snippet replicates the problem and produces much
simpler output.

-perl 5.8.5, net-snmp 5.0.9


--sk

stuart kendrick
fhcrc
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,053
Latest member
BrodieSola

Latest Threads

Top