X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/32f46b5c30131a9ba5bbadd28da6425434aca47f..b72bdf1132e50a6bb5d1d11d4ed239a34866e5e1:/sshrand.c diff --git a/sshrand.c b/sshrand.c index 26fcfe52..b728fd95 100644 --- a/sshrand.c +++ b/sshrand.c @@ -4,6 +4,7 @@ #include "putty.h" #include "ssh.h" +#include /* Collect environmental noise every 5 minutes */ #define NOISE_REGULAR_INTERVAL (5*60*TICKSPERSEC) @@ -225,6 +226,10 @@ void random_ref(void) void random_unref(void) { random_active--; + assert(random_active >= 0); + if (random_active) return; + + expire_timer_context(&pool); } int random_byte(void)