examples/fips_validation: fix resetting pointer
authorCiara Power <ciara.power@intel.com>
Thu, 12 Aug 2021 14:24:35 +0000 (14:24 +0000)
committerAkhil Goyal <gakhil@marvell.com>
Fri, 8 Oct 2021 19:31:07 +0000 (21:31 +0200)
The env.digest memory was freed, but the pointer was not set to NULL
afterwards. This caused an "Invalid Memory" error, as the pointer tries
to free twice.

Fixes: 952e10cdad5e ("examples/fips_validation: support scatter gather list")
Cc: stable@dpdk.org
Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
examples/fips_validation/main.c

index c0e68b8..b0de3d2 100644 (file)
@@ -1843,8 +1843,10 @@ error_one_case:
 
        fips_test_clear();
 
-       if (env.digest)
+       if (env.digest) {
                rte_free(env.digest);
+               env.digest = NULL;
+       }
        if (env.mbuf)
                rte_pktmbuf_free(env.mbuf);