summaryrefslogtreecommitdiffstats
path: root/zebra
diff options
context:
space:
mode:
authorRajasekar Raja <rajasekarr@nvidia.com>2023-10-09 18:54:54 +0200
committerRajasekar Raja <rajasekarr@nvidia.com>2023-10-09 19:09:57 +0200
commit11b987ed2f7d85fa3a6e2c05add3ab7f34834ba5 (patch)
treecea9f6f55216ba1bef353bdca3d8ec2a08e4e687 /zebra
parentMerge pull request #14543 from mjstapp/fix_pbr_rule_unique (diff)
downloadfrr-11b987ed2f7d85fa3a6e2c05add3ab7f34834ba5.tar.xz
frr-11b987ed2f7d85fa3a6e2c05add3ab7f34834ba5.zip
zebra: Prevent leaking ctx memory in err condition
When netlink_link_change() errors out for a new link for interface without MTU set, the allocated ctx is not freed.. Adding code for correctness Ticket# 3628313 Signed-off-by: Rajasekar Raja <rajasekarr@nvidia.com>
Diffstat (limited to 'zebra')
-rw-r--r--zebra/if_netlink.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/zebra/if_netlink.c b/zebra/if_netlink.c
index 61a8c6a78..ed2e0a224 100644
--- a/zebra/if_netlink.c
+++ b/zebra/if_netlink.c
@@ -1622,6 +1622,7 @@ int netlink_link_change(struct nlmsghdr *h, ns_id_t ns_id, int startup)
zlog_debug(
"RTM_NEWLINK for interface %s(%u) without MTU set",
name, ifi->ifi_index);
+ dplane_ctx_fini(&ctx);
return 0;
}
dplane_ctx_set_ifp_mtu(ctx, *(int *)RTA_DATA(tb[IFLA_MTU]));