Fix error handling in rand_drbg_new

Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/7519)
This commit is contained in:
Bernd Edlinger 2018-10-30 20:57:53 +01:00
parent f98a893ed4
commit ee5a79104c

View file

@ -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;
}