mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-26 01:32:25 +00:00
Fix a memory leak in ssh1_channel_close_local.
Leak Sanitiser was kind enough to point this out to me during testing of the port forwarding rework: chan_log_close_msg() returns a dynamically allocated char *, which the caller is supposed to free.
This commit is contained in:
parent
2160205aee
commit
22350d7668
@ -520,10 +520,12 @@ static void ssh1_channel_close_local(struct ssh1_channel *c,
|
|||||||
{
|
{
|
||||||
struct ssh1_connection_state *s = c->connlayer;
|
struct ssh1_connection_state *s = c->connlayer;
|
||||||
PacketProtocolLayer *ppl = &s->ppl; /* for ppl_logevent */
|
PacketProtocolLayer *ppl = &s->ppl; /* for ppl_logevent */
|
||||||
const char *msg = chan_log_close_msg(c->chan);
|
char *msg = chan_log_close_msg(c->chan);
|
||||||
|
|
||||||
if (msg != NULL)
|
if (msg != NULL) {
|
||||||
ppl_logevent("%s%s%s", msg, reason ? " " : "", reason ? reason : "");
|
ppl_logevent("%s%s%s", msg, reason ? " " : "", reason ? reason : "");
|
||||||
|
sfree(msg);
|
||||||
|
}
|
||||||
|
|
||||||
chan_free(c->chan);
|
chan_free(c->chan);
|
||||||
c->chan = zombiechan_new();
|
c->chan = zombiechan_new();
|
||||||
|
Loading…
Reference in New Issue
Block a user