Skip to content

Commit

Permalink
random_ref() should always increment the reference count.
Browse files Browse the repository at this point in the history
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.

[originally from svn r10049]
  • Loading branch information
sgtatham committed Oct 9, 2013
1 parent 2ca13fa commit ab2ddd1
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions sshrand.c
Expand Up @@ -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)
Expand Down

0 comments on commit ab2ddd1

Please sign in to comment.