projects
/
u
/
mdw
/
putty
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix a memory leak in parse_ttymodes() (found by Memcheck/Valgrind).
[u/mdw/putty]
/
ssh.c
diff --git
a/ssh.c
b/ssh.c
index
bfc10b0
..
bdab733
100644
(file)
--- 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.
*/
* 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);
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' */
}
}
}
}