VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Common/Random.c
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2014-12-08 18:38:31 +0100
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2014-12-11 18:31:29 +0100
commitfd0e434087ee51d8bc7be6ea1287685d91dc4b1e (patch)
tree7229a153be21dc2f388d317de7dd8c2820f6e516 /src/Common/Random.c
parent84a279a83ff32eb31203a6c876ff26d009da4dec (diff)
downloadVeraCrypt-fd0e434087ee51d8bc7be6ea1287685d91dc4b1e.tar.gz
VeraCrypt-fd0e434087ee51d8bc7be6ea1287685d91dc4b1e.zip
Windows: correct lock issue in RandgetBytes by releasing critical section in case of error.
Diffstat (limited to 'src/Common/Random.c')
-rw-r--r--src/Common/Random.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/Common/Random.c b/src/Common/Random.c
index 54192cb2..76ff6b61 100644
--- a/src/Common/Random.c
+++ b/src/Common/Random.c
@@ -363,6 +363,7 @@ BOOL RandgetBytes (unsigned char *buf, int len, BOOL forceSlowPoll)
{
Error ("ERR_NOT_ENOUGH_RANDOM_DATA");
len = RNG_POOL_SIZE;
+ LeaveCriticalSection (&critRandProt);
return FALSE;
}