summaryrefslogtreecommitdiffstats
path: root/src/vnet/srv6/sr_api.c
diff options
context:
space:
mode:
authorJohn Lo <loj@cisco.com>2018-09-13 15:08:08 -0400
committerDamjan Marion <dmarion@me.com>2018-09-14 05:03:42 +0000
commitd23d39cc012e5b1075a2323d6e940ae5ad43de46 (patch)
tree2f2c4f4ba593e08607ec8a0d1728b53983727934 /src/vnet/srv6/sr_api.c
parent12a30202ec213d1ffbee503e61b1cec0bc4861bb (diff)
Fix memory leak in API/CLI to create/modify SR policies
The segment list vector built by the API/CLI is not freed after SR policy creation or modification. Change-Id: If439005481cada6c6af7cb560fe7a4381dd49384 Signed-off-by: John Lo <loj@cisco.com>
Diffstat (limited to 'src/vnet/srv6/sr_api.c')
-rw-r--r--src/vnet/srv6/sr_api.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/vnet/srv6/sr_api.c b/src/vnet/srv6/sr_api.c
index 17d4821ec1d..c37923f7b01 100644
--- a/src/vnet/srv6/sr_api.c
+++ b/src/vnet/srv6/sr_api.c
@@ -114,6 +114,7 @@ vl_api_sr_policy_add_t_handler (vl_api_sr_policy_add_t * mp)
segments,
ntohl (mp->sids.weight),
mp->type, ntohl (mp->fib_table), mp->is_encap);
+ vec_free (segments);
REPLY_MACRO (VL_API_SR_POLICY_ADD_REPLY);
}
@@ -147,6 +148,7 @@ vl_api_sr_policy_mod_t_handler (vl_api_sr_policy_mod_t * mp)
mp->operation,
segments, ntohl (mp->sl_index),
ntohl (mp->sids.weight));
+ vec_free (segments);
REPLY_MACRO (VL_API_SR_POLICY_MOD_REPLY);
}