diff options
author | Rajasekar Raja <rajasekarr@nvidia.com> | 2023-10-09 18:54:54 +0200 |
---|---|---|
committer | Rajasekar Raja <rajasekarr@nvidia.com> | 2023-10-09 19:09:57 +0200 |
commit | 11b987ed2f7d85fa3a6e2c05add3ab7f34834ba5 (patch) | |
tree | cea9f6f55216ba1bef353bdca3d8ec2a08e4e687 /zebra | |
parent | Merge pull request #14543 from mjstapp/fix_pbr_rule_unique (diff) | |
download | frr-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.c | 1 |
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])); |