aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/vnet/srmpls/sr_mpls_api.c2
-rwxr-xr-xsrc/vnet/srmpls/sr_mpls_policy.c2
-rw-r--r--src/vnet/srv6/sr_api.c2
-rwxr-xr-xsrc/vnet/srv6/sr_policy_rewrite.c2
4 files changed, 8 insertions, 0 deletions
diff --git a/src/vnet/srmpls/sr_mpls_api.c b/src/vnet/srmpls/sr_mpls_api.c
index a6294e391b6..2c36c0dd9f2 100644
--- a/src/vnet/srmpls/sr_mpls_api.c
+++ b/src/vnet/srmpls/sr_mpls_api.c
@@ -67,6 +67,7 @@ vl_api_sr_mpls_policy_add_t_handler (vl_api_sr_mpls_policy_add_t * mp)
int rv = 0;
rv = sr_mpls_policy_add (ntohl (mp->bsid),
segments, mp->type, ntohl (mp->weight));
+ vec_free (segments);
REPLY_MACRO (VL_API_SR_MPLS_POLICY_ADD_REPLY);
}
@@ -91,6 +92,7 @@ vl_api_sr_mpls_policy_mod_t_handler (vl_api_sr_mpls_policy_mod_t * mp)
rv = sr_mpls_policy_mod (ntohl (mp->bsid),
mp->operation, segments, ntohl (mp->sl_index),
ntohl (mp->weight));
+ vec_free (segments);
REPLY_MACRO (VL_API_SR_MPLS_POLICY_MOD_REPLY);
}
diff --git a/src/vnet/srmpls/sr_mpls_policy.c b/src/vnet/srmpls/sr_mpls_policy.c
index 86cd169716a..8fc7e730e47 100755
--- a/src/vnet/srmpls/sr_mpls_policy.c
+++ b/src/vnet/srmpls/sr_mpls_policy.c
@@ -502,6 +502,7 @@ sr_mpls_policy_command_fn (vlib_main_t * vm, unformat_input_t * input,
rv = sr_mpls_policy_add (bsid, segments,
(is_spray ? SR_POLICY_TYPE_SPRAY :
SR_POLICY_TYPE_DEFAULT), weight);
+ vec_free (segments);
}
else if (is_del)
rv = sr_mpls_policy_del (bsid);
@@ -516,6 +517,7 @@ sr_mpls_policy_command_fn (vlib_main_t * vm, unformat_input_t * input,
if (operation == 3 && weight == (u32) ~ 0)
return clib_error_return (0, "No new weight for the SL specified");
rv = sr_mpls_policy_mod (bsid, operation, segments, sl_index, weight);
+ vec_free (segments);
}
switch (rv)
{
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);
}
diff --git a/src/vnet/srv6/sr_policy_rewrite.c b/src/vnet/srv6/sr_policy_rewrite.c
index ad73d29d518..62ce224cd8e 100755
--- a/src/vnet/srv6/sr_policy_rewrite.c
+++ b/src/vnet/srv6/sr_policy_rewrite.c
@@ -886,6 +886,7 @@ sr_policy_command_fn (vlib_main_t * vm, unformat_input_t * input,
rv = sr_policy_add (&bsid, segments, weight,
(is_spray ? SR_POLICY_TYPE_SPRAY :
SR_POLICY_TYPE_DEFAULT), fib_table, is_encap);
+ vec_free (segments);
}
else if (is_del)
rv = sr_policy_del ((sr_policy_index != (u32) ~ 0 ? NULL : &bsid),
@@ -903,6 +904,7 @@ sr_policy_command_fn (vlib_main_t * vm, unformat_input_t * input,
rv = sr_policy_mod ((sr_policy_index != (u32) ~ 0 ? NULL : &bsid),
sr_policy_index, fib_table, operation, segments,
sl_index, weight);
+ vec_free (segments);
}
switch (rv)