]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra: fix route node leak on error path
authorRenato Westphal <renato@opensourcerouting.org>
Wed, 13 Sep 2017 20:45:16 +0000 (17:45 -0300)
committerRenato Westphal <renato@opensourcerouting.org>
Tue, 24 Oct 2017 12:23:33 +0000 (10:23 -0200)
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
zebra/zebra_vty.c

index 889cdcfa990b3b6e067306fc70ece99c442697a2..95c35e62eac784019f4601eef1d1f20dedd5961a 100644 (file)
@@ -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;
        }