summaryrefslogtreecommitdiffstats
path: root/python-ethtool/etherinfo.c
diff options
context:
space:
mode:
Diffstat (limited to 'python-ethtool/etherinfo.c')
-rw-r--r--python-ethtool/etherinfo.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/python-ethtool/etherinfo.c b/python-ethtool/etherinfo.c
index 3d2072b..5539cf7 100644
--- a/python-ethtool/etherinfo.c
+++ b/python-ethtool/etherinfo.c
@@ -59,16 +59,14 @@
void free_ipv6addresses(struct ipv6address *ptr) {
struct ipv6address *ipv6ptr = ptr;
- if( !ptr ) {
- return;
- }
-
while( ipv6ptr ) {
struct ipv6address *tmp = ipv6ptr->next;
if( ipv6ptr->address ) {
free(ipv6ptr->address);
+ ipv6ptr->address = NULL;
}
+ memset(ipv6ptr, 0, sizeof(struct ipv6address));
free(ipv6ptr);
ipv6ptr = tmp;
}