summaryrefslogtreecommitdiffstats
path: root/ospfd/ospfd.c
diff options
context:
space:
mode:
authorRafael Zalamena <rzalamena@opensourcerouting.org>2022-12-15 13:54:33 +0100
committerRafael Zalamena <rzalamena@opensourcerouting.org>2022-12-20 12:51:13 +0100
commit9bf19426e04fcf79c798d8b5d7edf5ab615816e9 (patch)
treeb8deb74e5cce97ce9a335ab6f51bbf4c91b2a70b /ospfd/ospfd.c
parentMerge pull request #12541 from manojvn/dbdesc_recv (diff)
downloadfrr-9bf19426e04fcf79c798d8b5d7edf5ab615816e9.tar.xz
frr-9bf19426e04fcf79c798d8b5d7edf5ab615816e9.zip
ospfd: fix SPF table memory leak
After `free()`ing a table also set it to NULL so when the instance release function is called we know whether the pointer is valid or not. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
Diffstat (limited to 'ospfd/ospfd.c')
-rw-r--r--ospfd/ospfd.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/ospfd/ospfd.c b/ospfd/ospfd.c
index 2403b567a..a5d40ad17 100644
--- a/ospfd/ospfd.c
+++ b/ospfd/ospfd.c
@@ -852,6 +852,10 @@ static void ospf_finish_final(struct ospf *ospf)
ospf_route_delete(ospf, ospf->new_table);
ospf_route_table_free(ospf->new_table);
}
+ if (ospf->oall_rtrs)
+ ospf_rtrs_free(ospf->oall_rtrs);
+ if (ospf->all_rtrs)
+ ospf_rtrs_free(ospf->all_rtrs);
if (ospf->old_rtrs)
ospf_rtrs_free(ospf->old_rtrs);
if (ospf->new_rtrs)