X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=sshrand.c;h=b728fd95f9268c78c3bd61313bd52279cbdfd61e;hb=615455a913d5d28c1368406474ae4bb06697bf44;hp=26fcfe5245200ac9bd7cd48a04373b855bd5e0f5;hpb=31133eb0775df1a9506e967462c8cc09463bb79a;p=PuTTY.git 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)