From 97e8f0802ce2055ce774b127b25a2e219ba2e01b Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Wed, 9 Oct 2013 18:38:35 +0000 Subject: [PATCH] random_ref() should always increment the reference count. No current PuTTY utility was calling random_ref more than once per run (ssh.c and the two main PuTTYgen programs call it once each), but if one ever does (or if derived code does), it will want the reference count to actually work sensibly. git-svn-id: http://svn.tartarus.org/sgt/putty@10049 cda61777-01e9-0310-a592-d414129be87e --- sshrand.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sshrand.c b/sshrand.c index c26fc757..ead39a9b 100644 --- a/sshrand.c +++ b/sshrand.c @@ -288,14 +288,13 @@ void random_ref(void) if (!random_active) { memset(&pool, 0, sizeof(pool)); /* just to start with */ - random_active++; - noise_get_heavy(random_add_heavynoise_bitbybit); random_stir(); next_noise_collection = schedule_timer(NOISE_REGULAR_INTERVAL, random_timer, &pool); } + random_active++; } void random_unref(void) -- 2.45.2