summaryrefslogtreecommitdiff
path: root/src/ipcpd/normal/pol/alternate_pff.c
diff options
context:
space:
mode:
authorSander Vrijders <sander.vrijders@ugent.be>2018-05-04 11:53:15 +0200
committerDimitri Staessens <dimitri.staessens@ugent.be>2018-05-04 12:11:17 +0200
commit7d6fabc5bfb227ed76376a68a820aa243b0d7f53 (patch)
treedc0cf9ba54bbbf1d482fd8fc5cefd40612b5b0ea /src/ipcpd/normal/pol/alternate_pff.c
parente92174e887bac9b18a6b5d18e04adaefd3bd4bc1 (diff)
downloadouroboros-7d6fabc5bfb227ed76376a68a820aa243b0d7f53.tar.gz
ouroboros-7d6fabc5bfb227ed76376a68a820aa243b0d7f53.zip
ipcpd: Fix bad memory handling in LFA policy
The Loop-Free Alternates policy had bad memory management in two places. In the calculation of the LFAs a table was freed in the first iteration of a loop, whereas it was still needed in the other iterations. It is now freed outside of the loop. In the alternate PFF the address structs were not freed upon shutdown, this has been added as well. It also fixes some bad initialization in the LFA calculation function. Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be> Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
Diffstat (limited to 'src/ipcpd/normal/pol/alternate_pff.c')
-rw-r--r--src/ipcpd/normal/pol/alternate_pff.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/ipcpd/normal/pol/alternate_pff.c b/src/ipcpd/normal/pol/alternate_pff.c
index cb438c5f..3cb99d9c 100644
--- a/src/ipcpd/normal/pol/alternate_pff.c
+++ b/src/ipcpd/normal/pol/alternate_pff.c
@@ -234,6 +234,7 @@ void alternate_pff_destroy(struct pff_i * pff_i)
htable_destroy(pff_i->table);
del_nhops_down(pff_i);
+ del_addrs(pff_i);
pthread_rwlock_destroy(&pff_i->lock);
free(pff_i);
}