diff options
author | Leung Lai Yung <benkerbuild@gmail.com> | 2021-12-27 04:14:20 +0000 |
---|---|---|
committer | Beno�t Ganne <bganne@cisco.com> | 2022-01-24 10:24:15 +0000 |
commit | afe31562a1ed873bee8e1abb3b18df27d1a09ba3 (patch) | |
tree | fb9ca6b903aceaa75bab523d178ceb8ba7bd722a | |
parent | 13b3e61c50fef613955e9cf065ae65ab7fad431e (diff) |
policer: fix memory leak
Type: fix
policer_add_del does not free "clib_error_t*" when it is not null.
Signed-off-by: Leung Lai Yung <benkerbuild@gmail.com>
Change-Id: I00ad8e53797e46adeb1819856262bb9f3c068c63
-rw-r--r-- | src/vnet/policer/policer_api.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/vnet/policer/policer_api.c b/src/vnet/policer/policer_api.c index 1382d17e2de..8c958e79676 100644 --- a/src/vnet/policer/policer_api.c +++ b/src/vnet/policer/policer_api.c @@ -67,7 +67,10 @@ vl_api_policer_add_del_t_handler (vl_api_policer_add_del_t * mp) error = policer_add_del (vm, name, &cfg, &policer_index, mp->is_add); if (error) - rv = VNET_API_ERROR_UNSPECIFIED; + { + rv = VNET_API_ERROR_UNSPECIFIED; + clib_error_free (error); + } /* *INDENT-OFF* */ REPLY_MACRO2(VL_API_POLICER_ADD_DEL_REPLY, |