From: Bernd Edlinger Date: Tue, 30 Oct 2018 19:57:53 +0000 (+0100) Subject: Fix error handling in rand_drbg_new X-Git-Tag: OpenSSL_1_1_1a~44 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ee5a79104c4f7f59343a7b75815be3979a0f6b83;p=openssl Fix error handling in rand_drbg_new Reviewed-by: Matthias St. Pierre Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/7519) --- diff --git a/crypto/rand/drbg_lib.c b/crypto/rand/drbg_lib.c index b9c1cca0e0..1471681cf4 100644 --- a/crypto/rand/drbg_lib.c +++ b/crypto/rand/drbg_lib.c @@ -234,10 +234,7 @@ static RAND_DRBG *rand_drbg_new(int secure, return drbg; err: - if (drbg->secure) - OPENSSL_secure_free(drbg); - else - OPENSSL_free(drbg); + RAND_DRBG_free(drbg); return NULL; }