Signed-off-by: Florian Forster <octo@leeloo.lan.home.verplant.org>
status = ping_iterator_get_info (iter, PING_INFO_HOSTNAME,
(void *) buffer, &buffer_size);
if (status != 0)
+ {
+ free (buffer);
break;
+ }
XPUSHs (sv_2mortal (newSVpvn(buffer,buffer_size)));
free(buffer);
$status = _ping_send ($obj->{'c_obj'});
if ($status < 0)
{
- print "\$status = $status;\n";
$obj->{'err_msg'} = "" . _ping_get_error ($obj->{'c_obj'});
return;
}
$iter = _ping_iterator_get ($obj->{'c_obj'});
+ if (!$iter)
+ {
+ $obj->{'err_msg'} = "" . _ping_get_error ($obj->{'c_obj'});
+ return;
+ }
+
while ($iter)
{
my $host = _ping_iterator_get_hostname ($iter);