Merge pull request #5055 from pguibert6WIND/fix_memory_leak_with_delete_interface

zebra: fix memory leak
This commit is contained in:
Mark Stapp 2019-09-25 10:03:26 -04:00 committed by GitHub
commit dd38ed3502
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;