changelog shortlog tags branches files raw gz bz2 help

Mercurial > hg > plan9front / changeset: sshnet: fix memory leak

changeset 7121: a69ea0d34942
parent 7120: 415689b1872a
child 7122: 20b91fedbefc
author: cinap_lenrek@felloff.net
date: Tue, 02 Apr 2019 18:06:25 +0200
files: sys/src/cmd/sshnet.c
description: sshnet: fix memory leak
     1.1--- a/sys/src/cmd/sshnet.c
     1.2+++ b/sys/src/cmd/sshnet.c
     1.3@@ -805,13 +805,11 @@ ctlwrite(Req *r, Client *c)
     1.4 			goto Badarg;
     1.5 		if(nf != 2)
     1.6 			goto Badarg;
     1.7+		free(c->connect);
     1.8 		c->connect = estrdup9p(f[1]);
     1.9 		nf = getfields(f[1], f, nelem(f), 0, "!");
    1.10-		if(nf != 2){
    1.11-			free(c->connect);
    1.12-			c->connect = nil;
    1.13+		if(nf != 2)
    1.14 			goto Badarg;
    1.15-		}
    1.16 		c->sendwin = MaxPacket;
    1.17 		c->recvwin = WinPackets * MaxPacket;
    1.18 		c->recvacc = 0;