diff options
| author | Stephen Hemminger <[email protected]> | 2023-03-22 18:04:28 -0700 |
|---|---|---|
| committer | Thomas Monjalon <[email protected]> | 2023-03-23 10:31:25 +0100 |
| commit | 3223d456062bb12e9e6cf02b97966f42affa4d11 (patch) | |
| tree | a47f83645a93d0263973a4f4db5feb4d0ebe347b /examples/fips_validation | |
| parent | 124ff913cda83f87be7817fa373fd07e22e1a881 (diff) | |
examples/fips_validation: remove unneeded null checks
No check for null pointer is necessary before calling free().
Fixes: 1ea7940e0f44 ("examples/fips_validation: add SHA3 validation")
Fixes: 225f04fb3e4c ("examples/fips_validation: add SHAKE validation")
Signed-off-by: Stephen Hemminger <[email protected]>
Diffstat (limited to 'examples/fips_validation')
| -rw-r--r-- | examples/fips_validation/main.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/examples/fips_validation/main.c b/examples/fips_validation/main.c index 2c4353185e..4c231fdb29 100644 --- a/examples/fips_validation/main.c +++ b/examples/fips_validation/main.c @@ -2288,8 +2288,7 @@ fips_mct_sha_test(void) max_outlen = md_blocks * vec.cipher_auth.digest.len; - if (vec.cipher_auth.digest.val) - free(vec.cipher_auth.digest.val); + free(vec.cipher_auth.digest.val); vec.cipher_auth.digest.val = calloc(1, max_outlen); @@ -2382,8 +2381,7 @@ fips_mct_shake_test(void) max_outlen = vec.cipher_auth.digest.len; - if (vec.cipher_auth.digest.val) - free(vec.cipher_auth.digest.val); + free(vec.cipher_auth.digest.val); vec.cipher_auth.digest.val = calloc(1, max_outlen); |
