提交 63a65d16 编写于 作者: D Dr. Matthias St. Pierre

DRBG: fix memory leak on error in rand_drbg_get_entropy()

Reviewed-by: NRichard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5918)
上级 55bd917b
......@@ -229,7 +229,7 @@ size_t rand_drbg_get_entropy(RAND_DRBG *drbg,
*/
RANDerr(RAND_F_RAND_DRBG_GET_ENTROPY,
RAND_R_PREDICTION_RESISTANCE_NOT_SUPPORTED);
return 0;
goto err;
}
/* Get entropy by polling system entropy sources. */
......@@ -241,6 +241,7 @@ size_t rand_drbg_get_entropy(RAND_DRBG *drbg,
*pout = rand_pool_detach(pool);
}
err:
rand_pool_free(pool);
return ret;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册