mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-01 19:54:40 +02:00
fix freeing a failed RNG
This commit is contained in:
@@ -507,6 +507,7 @@ int wc_FreeRng(RNG* rng)
|
||||
int ret = BAD_FUNC_ARG;
|
||||
|
||||
if (rng != NULL) {
|
||||
if (rng->drbg != NULL) {
|
||||
if (Hash_DRBG_Uninstantiate(rng->drbg) == DRBG_SUCCESS)
|
||||
ret = 0;
|
||||
else
|
||||
@@ -514,6 +515,8 @@ int wc_FreeRng(RNG* rng)
|
||||
|
||||
XFREE(rng->drbg, NULL, DYNAMIC_TYPE_RNG);
|
||||
rng->drbg = NULL;
|
||||
}
|
||||
|
||||
rng->status = DRBG_NOT_INIT;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user