summaryrefslogtreecommitdiff
path: root/zebra/interface.c
diff options
context:
space:
mode:
authorMark Stapp <mjs@voltanet.io>2019-09-25 10:03:26 -0400
committerGitHub <noreply@github.com>2019-09-25 10:03:26 -0400
commitdd38ed3502cb73ae89c24d972390420206657650 (patch)
tree2b906bc4d8510775c9cc69464a7362cd6ce9d2c0 /zebra/interface.c
parent59aa96313af214dce0d00be3de73d2c105f555d0 (diff)
parentfc341a97917b7f808ea9f72b7cab9feb3b7e4024 (diff)
Merge pull request #5055 from pguibert6WIND/fix_memory_leak_with_delete_interface
zebra: fix memory leak
Diffstat (limited to 'zebra/interface.c')
-rw-r--r--zebra/interface.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/zebra/interface.c b/zebra/interface.c
index 940bc2b1c9..b9a49c5190 100644
--- a/zebra/interface.c
+++ b/zebra/interface.c
@@ -270,8 +270,10 @@ struct interface *if_lookup_by_name_per_ns(struct zebra_ns *ns,
for (rn = route_top(ns->if_table); rn; rn = route_next(rn)) {
ifp = (struct interface *)rn->info;
- if (ifp && strcmp(ifp->name, ifname) == 0)
+ if (ifp && strcmp(ifp->name, ifname) == 0) {
+ route_unlock_node(rn);
return (ifp);
+ }
}
return NULL;