1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-03-22 14:39:24 -05:00

Fix a couple of memory leaks pointed out by Adam Bernstein.

[originally from svn r3262]
This commit is contained in:
Ben Harris 2003-06-14 18:27:10 +00:00
parent a4d89d1d3e
commit 3006ebf15c
2 changed files with 6 additions and 1 deletions

5
ssh.c
View File

@ -2149,8 +2149,10 @@ static const char *connect_to_host(Ssh ssh, char *host, int port,
*/ */
logeventf(ssh, "Looking up host \"%s\"", host); logeventf(ssh, "Looking up host \"%s\"", host);
addr = name_lookup(host, port, realhost, &ssh->cfg); addr = name_lookup(host, port, realhost, &ssh->cfg);
if ((err = sk_addr_error(addr)) != NULL) if ((err = sk_addr_error(addr)) != NULL) {
sk_addr_free(addr);
return err; return err;
}
/* /*
* Open socket. * Open socket.
@ -2163,6 +2165,7 @@ static const char *connect_to_host(Ssh ssh, char *host, int port,
ssh->fn = &fn_table; ssh->fn = &fn_table;
ssh->s = new_connection(addr, *realhost, port, ssh->s = new_connection(addr, *realhost, port,
0, 1, nodelay, (Plug) ssh, &ssh->cfg); 0, 1, nodelay, (Plug) ssh, &ssh->cfg);
sk_addr_free(addr);
if ((err = sk_socket_error(ssh->s)) != NULL) { if ((err = sk_socket_error(ssh->s)) != NULL) {
ssh->s = NULL; ssh->s = NULL;
return err; return err;

View File

@ -140,6 +140,8 @@ Bignum dh_create_e(void *handle, int nbits)
} }
} while (bignum_cmp(ctx->x, One) <= 0 || bignum_cmp(ctx->x, ctx->q) >= 0); } while (bignum_cmp(ctx->x, One) <= 0 || bignum_cmp(ctx->x, ctx->q) >= 0);
sfree(buf);
/* /*
* Done. Now compute e = g^x mod p. * Done. Now compute e = g^x mod p.
*/ */