summaryrefslogtreecommitdiffstats
path: root/lib/if.c
diff options
context:
space:
mode:
authorDon Slice <dslice@cumulusnetworks.com>2016-06-27 13:34:32 +0200
committerDon Slice <dslice@cumulusnetworks.com>2016-06-28 13:52:38 +0200
commit3f6d6a5db80fd465e15383ee96867153578fc316 (patch)
tree24309bf26544f8828d22707362df4a7270f56e14 /lib/if.c
parentpimd: Fix register receive pointer arithmetic (diff)
downloadfrr-3f6d6a5db80fd465e15383ee96867153578fc316.tar.xz
frr-3f6d6a5db80fd465e15383ee96867153578fc316.zip
zebra/ospf/ospf6: Fix several memory leaks on if up/down
Resolved several memory leaks caused by ifdown/ifup the vrf device or a swp port. For bgp/zebra/ospf/ospf6, bouncing the vrf device would cause a linked list, Interface, and route-table to get leaked. For ospf6, bouncing the swp device also caused leaks of Connected and Prefix entries. Ticket: CM-10841 Signed-off-by: Don Slice Reviewed-By: Donald Sharp Testing Done: Manual testing, bgp and ospf mins passed, smokes had fewer failures than base
Diffstat (limited to 'lib/if.c')
-rw-r--r--lib/if.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/if.c b/lib/if.c
index 97edf1769..8f1461326 100644
--- a/lib/if.c
+++ b/lib/if.c
@@ -1292,6 +1292,12 @@ if_terminate (struct list **intf_list)
if (ifp == NULL)
break;
+ if (ifp->node)
+ {
+ ifp->node->info = NULL;
+ route_unlock_node (ifp->node);
+ }
+
if_delete (ifp);
}