Set vector pointer to NULL after free to avoid calling rte_free()
on the same pointer twice in some cases.

Signed-off-by: Emma Finn <[email protected]>
---
v2:
* add fix to mct_shake_test
---
 examples/fips_validation/main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/examples/fips_validation/main.c b/examples/fips_validation/main.c
index daf273bc85..2b6d55aa51 100644
--- a/examples/fips_validation/main.c
+++ b/examples/fips_validation/main.c
@@ -2610,7 +2610,7 @@ fips_mct_sha_test(void)
                rte_free(md[i].val);
 
        rte_free(vec.pt.val);
-
+       vec.pt.val = NULL;
        rte_free(val.val);
        return 0;
 }
@@ -2698,6 +2698,7 @@ fips_mct_shake_test(void)
 
        rte_free(md.val);
        rte_free(vec.pt.val);
+       vec.pt.val = NULL;
        rte_free(val.val);
        return 0;
 }
-- 
2.43.0

Reply via email to