summaryrefslogtreecommitdiffstats
path: root/clientloop.c
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2008-06-13 04:55:46 +1000
committerDarren Tucker <dtucker@zip.com.au>2008-06-13 04:55:46 +1000
commit84c56f536ca664f79172d595e088fce6aa84be21 (patch)
treeed9f037d4935c1bb0a59c8a0dd3e815883a07fa2 /clientloop.c
parent4b3b9773ec9d5e0de31a1a8e113488497c7113dc (diff)
- djm@cvs.openbsd.org 2008/06/12 15:19:17
[clientloop.h channels.h clientloop.c channels.c mux.c] The multiplexing escape char handler commit last night introduced a small memory leak per session; plug it.
Diffstat (limited to 'clientloop.c')
-rw-r--r--clientloop.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/clientloop.c b/clientloop.c
index 663daae7..d2407ed7 100644
--- a/clientloop.c
+++ b/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
@@ -1260,6 +1260,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)
{
@@ -1357,6 +1364,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,