summaryrefslogtreecommitdiffstats
path: root/eigrpd/eigrp_interface.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2017-06-10 22:09:29 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2017-06-10 22:09:29 +0200
commit60805e322ec54242c996e235a486b27e2a5f8cfe (patch)
treefa533c88dec9b9952f31f9433360d7c67aa809c3 /eigrpd/eigrp_interface.c
parenteigrpd: Fix use after free (diff)
downloadfrr-60805e322ec54242c996e235a486b27e2a5f8cfe.tar.xz
frr-60805e322ec54242c996e235a486b27e2a5f8cfe.zip
eigrpd: Cleanup leaked dest_addr
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'eigrpd/eigrp_interface.c')
-rw-r--r--eigrpd/eigrp_interface.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/eigrpd/eigrp_interface.c b/eigrpd/eigrp_interface.c
index 26643452c..a9deafe25 100644
--- a/eigrpd/eigrp_interface.c
+++ b/eigrpd/eigrp_interface.c
@@ -291,13 +291,13 @@ eigrp_if_up (struct eigrp_interface *ei)
/*Add connected entry to topology table*/
- struct prefix_ipv4 *dest_addr = prefix_ipv4_new ();
+ struct prefix_ipv4 dest_addr;
- dest_addr->family = AF_INET;
- dest_addr->prefix = ei->connected->address->u.prefix4;
- dest_addr->prefixlen = ei->connected->address->prefixlen;
- apply_mask_ipv4 (dest_addr);
- pe = eigrp_topology_table_lookup_ipv4 (eigrp->topology_table, dest_addr);
+ dest_addr.family = AF_INET;
+ dest_addr.prefix = ei->connected->address->u.prefix4;
+ dest_addr.prefixlen = ei->connected->address->prefixlen;
+ apply_mask_ipv4 (&dest_addr);
+ pe = eigrp_topology_table_lookup_ipv4 (eigrp->topology_table, &dest_addr);
if (pe == NULL)
{
@@ -305,7 +305,7 @@ eigrp_if_up (struct eigrp_interface *ei)
pe->serno = eigrp->serno;
pe->destination_ipv4 = prefix_ipv4_new ();
prefix_copy ((struct prefix *)pe->destination_ipv4,
- (struct prefix *)dest_addr);
+ (struct prefix *)&dest_addr);
pe->af = AF_INET;
pe->nt = EIGRP_TOPOLOGY_TYPE_CONNECTED;