]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Fix coverity 1503330 use after free
authorPauli <pauli@openssl.org>
Fri, 1 Apr 2022 01:12:07 +0000 (12:12 +1100)
committerPauli <pauli@openssl.org>
Fri, 6 May 2022 08:21:22 +0000 (18:21 +1000)
This is a false positive resulting from confusion over up_ref/free.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/18014)

test/acvp_test.c

index bbc77d0ae610d69bc54a4e57814e502098d085ff..90a97e2bf4c85eef7b2265dd7768991124e26257 100644 (file)
@@ -1381,6 +1381,8 @@ static int drbg_test(int id)
     res = 1;
 err:
     EVP_RAND_CTX_free(ctx);
+    /* Coverity is confused by the upref/free in EVP_RAND_CTX_new() subdue it */
+    /* coverity[pass_freed_arg] */
     EVP_RAND_CTX_free(parent);
     EVP_RAND_free(rand);
     return res;