diff options
author | Rafael Zalamena <rzalamena@opensourcerouting.org> | 2022-12-15 13:54:33 +0100 |
---|---|---|
committer | Rafael Zalamena <rzalamena@opensourcerouting.org> | 2022-12-20 12:51:13 +0100 |
commit | 9bf19426e04fcf79c798d8b5d7edf5ab615816e9 (patch) | |
tree | b8deb74e5cce97ce9a335ab6f51bbf4c91b2a70b /ospfd/ospfd.c | |
parent | Merge pull request #12541 from manojvn/dbdesc_recv (diff) | |
download | frr-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.c | 4 |
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) |