changelog shortlog tags branches files raw gz bz2 help

Mercurial > hg > plan9front / changeset: sshnet: don't leak error string

changeset 7130: b7844d3b2bdf
parent 7129: 819322c2a38f
child 7131: 764656b4f929
author: cinap_lenrek@felloff.net
date: Wed, 03 Apr 2019 14:29:49 +0200
files: sys/src/cmd/sshnet.c
description: sshnet: don't leak error string
     1.1--- a/sys/src/cmd/sshnet.c
     1.2+++ b/sys/src/cmd/sshnet.c
     1.3@@ -1103,12 +1103,11 @@ handlemsg(Msg *m)
     1.4 			break;
     1.5 		}
     1.6 		c = getclient(chan);
     1.7-		if(c == nil || c->state != Dialing){
     1.8-			free(s);
     1.9-			break;
    1.10+		if(c != nil && c->state == Dialing){
    1.11+			c->state = Closed;
    1.12+			hangupclient(c, s);
    1.13 		}
    1.14-		c->state = Closed;
    1.15-		hangupclient(c, s);
    1.16+		free(s);
    1.17 		break;
    1.18 	}
    1.19 	free(m);