diff --git a/bindings/perl/Oping.xs b/bindings/perl/Oping.xs
index 6376775e022bb912d8067f712a96d2afac88e83d..19da01c5c14405e5ba5ec2de8d15b81ab6498fee 100644 (file)
--- a/bindings/perl/Oping.xs
+++ b/bindings/perl/Oping.xs
+/**
+ * Net-Oping - Oping.xs
+ * Copyright (C) 2007 Olivier Fredj
+ * Copyright (C) 2008,2009 Florian octo Forster
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; only version 2 of the License is
+ * applicable.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Authors:
+ * Olivier Fredj <ofredj at proxad.net>
+ * Florian octo Forster <octo at verplant.org>
+ */
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
(void *) buffer, &buffer_size);
if (status != ENOMEM)
break;
-
- /* FIXME: This is a workaround for a bug in 0.3.5. */
+#if !defined(OPING_VERSION) || (OPING_VERSION <= 3005)
+ /* This is a workaround for a bug in 0.3.5. */
buffer_size++;
+#endif
buffer = (char *) malloc (buffer_size);
if (buffer == NULL)
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);