mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-03-22 06:38:37 -05:00
Fix a couple of memory leaks pointed out by Adam Bernstein.
[originally from svn r3262]
This commit is contained in:
parent
a4d89d1d3e
commit
3006ebf15c
5
ssh.c
5
ssh.c
@ -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;
|
||||||
|
2
sshdh.c
2
sshdh.c
@ -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.
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user