From 05a95ab8adc726094a850872c56c29d5fc2d4098 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Sat, 16 Jul 2022 18:59:51 -0400 Subject: [PATCH 1/3] lib: Prevent Uninitialized usage of data Valgrind is reporting that prefix is being used uninitialized. Signed-off-by: Donald Sharp --- lib/filter_nb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/filter_nb.c b/lib/filter_nb.c index 35b97a9bde..3ed1f3e03e 100644 --- a/lib/filter_nb.c +++ b/lib/filter_nb.c @@ -428,7 +428,7 @@ static void plist_dnode_to_prefix(const struct lyd_node *dnode, bool *any, static int _plist_is_dup(const struct lyd_node *dnode, void *arg) { struct plist_dup_args *pda = arg; - struct prefix p; + struct prefix p = {}; int ge, le; bool any; From 9d1fec4c7e1770e83eecb304a0cd807cb41186e9 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Sat, 16 Jul 2022 19:00:43 -0400 Subject: [PATCH 2/3] zebra: When deleting nexthop group entries ensure the thread is off Signed-off-by: Donald Sharp --- zebra/zebra_nhg.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/zebra/zebra_nhg.c b/zebra/zebra_nhg.c index 8a255981b7..f846164834 100644 --- a/zebra/zebra_nhg.c +++ b/zebra/zebra_nhg.c @@ -1611,6 +1611,8 @@ void zebra_nhg_free(struct nhg_hash_entry *nhe) nhe->nhg.nexthop); } + THREAD_OFF(nhe->timer); + if (nhe->refcnt) zlog_debug("nhe_id=%pNG hash refcnt=%d", nhe, nhe->refcnt); From 2e4e3ba10b21abcf6fa89b0f1c1a8559bb0b4ce6 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Sat, 16 Jul 2022 19:01:12 -0400 Subject: [PATCH 3/3] zebra: Delete the malloced memory under `show zebra` Signed-off-by: Donald Sharp --- zebra/zebra_vty.c | 1 + 1 file changed, 1 insertion(+) diff --git a/zebra/zebra_vty.c b/zebra/zebra_vty.c index e6038d0bc2..525e0366e7 100644 --- a/zebra/zebra_vty.c +++ b/zebra/zebra_vty.c @@ -4033,6 +4033,7 @@ DEFUN (show_zebra, vty_out(vty, "%s\n", out); XFREE(MTYPE_TMP, out); + ttable_del(table); vty_out(vty, " Route Route Neighbor LSP LSP\n"); vty_out(vty,