mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-06-30 19:12:48 -05:00
Plug a few minor memory leaks, based on a patch by Sirp Potijk.
While I'm here, add an assertion in sshrand.c to catch mistakes in reference counting. [originally from svn r8846]
This commit is contained in:
@ -4,6 +4,7 @@
|
||||
|
||||
#include "putty.h"
|
||||
#include "ssh.h"
|
||||
#include <assert.h>
|
||||
|
||||
/* 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)
|
||||
|
Reference in New Issue
Block a user