diff options
author | 2008-06-12 15:19:17 +0000 | |
---|---|---|
committer | 2008-06-12 15:19:17 +0000 | |
commit | 4eb6e6e968700cd61f82b159d17d00489d733532 (patch) | |
tree | 829bfce67c02ff1d69a3bf9cc147377363cfc646 /usr.bin/ssh/clientloop.c | |
parent | Remove some crazy #if mess. (diff) | |
download | wireguard-openbsd-4eb6e6e968700cd61f82b159d17d00489d733532.tar.xz wireguard-openbsd-4eb6e6e968700cd61f82b159d17d00489d733532.zip |
The multiplexing escape char handler commit last night introduced a
small memory leak per session; plug it.
Diffstat (limited to 'usr.bin/ssh/clientloop.c')
-rw-r--r-- | usr.bin/ssh/clientloop.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/usr.bin/ssh/clientloop.c b/usr.bin/ssh/clientloop.c index 3b1ceb8fc0b..1d73a0f529c 100644 --- a/usr.bin/ssh/clientloop.c +++ b/usr.bin/ssh/clientloop.c @@ -1,4 +1,4 @@ -/* $OpenBSD: clientloop.c,v 1.197 2008/06/12 04:17:47 djm Exp $ */ +/* $OpenBSD: clientloop.c,v 1.198 2008/06/12 15:19:17 djm Exp $ */ /* * Author: Tatu Ylonen <ylo@cs.hut.fi> * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland @@ -1252,6 +1252,13 @@ client_new_escape_filter_ctx(int escape_char) return (void *)ret; } +/* Free the escape filter context on channel free */ +void +client_filter_cleanup(int cid, void *ctx) +{ + xfree(ctx); +} + int client_simple_escape_filter(Channel *c, char *buf, int len) { @@ -1349,6 +1356,7 @@ client_loop(int have_pty, int escape_char_arg, int ssh2_chan_id) if (escape_char_arg != SSH_ESCAPECHAR_NONE) channel_register_filter(session_ident, client_simple_escape_filter, NULL, + client_filter_cleanup, client_new_escape_filter_ctx(escape_char_arg)); if (session_ident != -1) channel_register_cleanup(session_ident, |