From ce0ff16bd900edb89d8b066d5d42b3486fe04313 Mon Sep 17 00:00:00 2001 From: Renato Westphal Date: Wed, 13 Sep 2017 17:45:16 -0300 Subject: [PATCH] zebra: fix route node leak on error path Signed-off-by: Renato Westphal --- zebra/zebra_vty.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/zebra/zebra_vty.c b/zebra/zebra_vty.c index 889cdcfa99..95c35e62ea 100644 --- a/zebra/zebra_vty.c +++ b/zebra/zebra_vty.c @@ -1360,6 +1360,8 @@ DEFUN (show_ip_route_prefix, rn = route_node_match(table, (struct prefix *)&p); if (!rn || rn->p.prefixlen != p.prefixlen) { + if (rn) + route_unlock_node(rn); vty_out(vty, "%% Network not in table\n"); return CMD_WARNING; } @@ -1947,6 +1949,8 @@ DEFUN (show_ipv6_route_prefix, rn = route_node_match(table, (struct prefix *)&p); if (!rn || rn->p.prefixlen != p.prefixlen) { + if (rn) + route_unlock_node(rn); vty_out(vty, "%% Network not in table\n"); return CMD_WARNING; } -- 2.39.5