Skip to content

Commit

Permalink
netdev-dpdk: fix ingress_policer leak on error path
Browse files Browse the repository at this point in the history
Fix memory leak by freeing the policer if rte_meter_srtcm_config fails.

Fixes: 9509913 ("netdev-dpdk.c: Add ingress-policing functionality.")
Signed-off-by: zhangliping <zhangliping02@baidu.com>
Signed-off-by: Ian Stokes <ian.stokes@intel.com>
  • Loading branch information
zhangliping authored and istokes committed Jan 17, 2018
1 parent 1fb924b commit 4c47ddd
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/netdev-dpdk.c
Expand Up @@ -2436,6 +2436,7 @@ netdev_dpdk_policer_construct(uint32_t rate, uint32_t burst)
&policer->app_srtcm_params);
if (err) {
VLOG_ERR("Could not create rte meter for ingress policer");
free(policer);
return NULL;
}

Expand Down

0 comments on commit 4c47ddd

Please sign in to comment.