From: Renato Westphal Date: Wed, 13 Sep 2017 20:45:16 +0000 (-0300) Subject: zebra: fix route node leak on error path X-Git-Tag: frr-4.0-dev~187^2~1 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=ce0ff16bd900edb89d8b066d5d42b3486fe04313;p=matthieu%2Ffrr.git zebra: fix route node leak on error path Signed-off-by: Renato Westphal --- 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; }