diff options
| author | Rajasekar Raja <rajasekarr@nvidia.com> | 2023-10-09 16:54:54 +0000 | 
|---|---|---|
| committer | Rajasekar Raja <rajasekarr@nvidia.com> | 2023-10-09 17:09:57 +0000 | 
| commit | 11b987ed2f7d85fa3a6e2c05add3ab7f34834ba5 (patch) | |
| tree | cea9f6f55216ba1bef353bdca3d8ec2a08e4e687 /zebra/if_netlink.c | |
| parent | b9668023622328468a30fe530bab86afdc914878 (diff) | |
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/if_netlink.c')
| -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 61a8c6a78a..ed2e0a224e 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]));  | 
