openbsd-ports/net/vnstat/patches/patch-src_ifinfo_c
pea 3af0884572 Update to 1.11
Initial diff from Gonzalo L. R. (gonzalo at x61.com.ar)

ok sthen@
2012-03-09 09:33:03 +00:00

26 lines
550 B
Plaintext

$OpenBSD: patch-src_ifinfo_c,v 1.2 2012/03/09 09:33:03 pea Exp $
Fixes a segfault with malloc option F
--- src/ifinfo.c.orig Wed Jun 1 00:29:51 2011
+++ src/ifinfo.c Thu Mar 8 17:30:31 2012
@@ -420,9 +420,9 @@ int readifaddrs(const char *iface)
break;
}
}
- freeifaddrs(ifap);
if (check == 0) {
+ freeifaddrs(ifap);
if (debug)
printf("Requested interface \"%s\" not found.\n", iface);
return 0;
@@ -435,6 +435,7 @@ int readifaddrs(const char *iface)
ifinfo.filled = 1;
}
+ freeifaddrs(ifap);
return 1;
}
#endif