From: Ben Harris Date: Mon, 27 Aug 2012 19:11:39 +0000 (+0000) Subject: Fix a memory leak in parse_ttymodes() (found by Memcheck/Valgrind). X-Git-Tag: 0.63~154 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=df83634e21d9442210ed244c9b4ff1a0c3fbd983;p=PuTTY.git Fix a memory leak in parse_ttymodes() (found by Memcheck/Valgrind). [originally from svn r9633] --- diff --git a/ssh.c b/ssh.c index bfc10b02..bdab733f 100644 --- a/ssh.c +++ b/ssh.c @@ -1062,12 +1062,14 @@ static void parse_ttymodes(Ssh ssh, * follows it, or 'A' indicating that we should pass the * value through from the local environment via get_ttymode. */ - if (val[0] == 'A') + if (val[0] == 'A') { val = get_ttymode(ssh->frontend, key); - else - val++; /* skip the 'V' */ - if (val) - do_mode(data, key, val); + if (val) { + do_mode(data, key, val); + sfree(val); + } + } else + do_mode(data, key, val + 1); /* skip the 'V' */ } }