evp_extra_test: Avoid potential double free of params
authorTomas Mraz <tomas@openssl.org>
Tue, 4 May 2021 13:38:48 +0000 (15:38 +0200)
committerTomas Mraz <tomas@openssl.org>
Thu, 6 May 2021 15:01:05 +0000 (17:01 +0200)
Fixes #14916

Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15135)

test/evp_extra_test.c

index f8fdc7287df3a09259c4443d273e363e4a78eba4..7fd45bc316d8ca89ecafdc20f5d6b76f2af6ee7b 100644 (file)
@@ -688,6 +688,7 @@ static int test_EC_priv_pub(void)
     if (!test_fromdata("EC", params))
         goto err;
     OSSL_PARAM_free(params);
+    params = NULL;
     OSSL_PARAM_BLD_free(bld);
 
     /* Test priv and !pub */
@@ -704,6 +705,7 @@ static int test_EC_priv_pub(void)
     if (!test_fromdata("EC", params))
         goto err;
     OSSL_PARAM_free(params);
+    params = NULL;
     OSSL_PARAM_BLD_free(bld);
 
     /* Test !priv and pub */
@@ -721,6 +723,7 @@ static int test_EC_priv_pub(void)
     if (!test_fromdata("EC", params))
         goto err;
     OSSL_PARAM_free(params);
+    params = NULL;
     OSSL_PARAM_BLD_free(bld);
 
     /* Test priv and pub */