summaryrefslogtreecommitdiffstats
path: root/channels.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 /channels.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 'channels.c')
-rw-r--r--channels.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/channels.c b/channels.c
index c539990f..04cd6b0a 100644
--- a/channels.c
+++ b/channels.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: channels.c,v 1.279 2008/06/12 03:40:52 djm Exp $ */
+/* $OpenBSD: channels.c,v 1.280 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
@@ -328,6 +328,8 @@ channel_new(char *ctype, int type, int rfd, int wfd, int efd,
c->open_confirm_ctx = NULL;
c->input_filter = NULL;
c->output_filter = NULL;
+ c->filter_ctx = NULL;
+ c->filter_cleanup = NULL;
TAILQ_INIT(&c->status_confirms);
debug("channel %d: new [%s]", found, remote_name);
return c;
@@ -416,6 +418,8 @@ channel_free(Channel *c)
bzero(cc, sizeof(*cc));
xfree(cc);
}
+ if (c->filter_cleanup != NULL && c->filter_ctx != NULL)
+ c->filter_cleanup(c->self, c->filter_ctx);
channels[c->self] = NULL;
xfree(c);
}
@@ -731,7 +735,7 @@ channel_cancel_cleanup(int id)
void
channel_register_filter(int id, channel_infilter_fn *ifn,
- channel_outfilter_fn *ofn, void *ctx)
+ channel_outfilter_fn *ofn, channel_filter_cleanup_fn *cfn, void *ctx)
{
Channel *c = channel_lookup(id);
@@ -742,6 +746,7 @@ channel_register_filter(int id, channel_infilter_fn *ifn,
c->input_filter = ifn;
c->output_filter = ofn;
c->filter_ctx = ctx;
+ c->filter_cleanup = cfn;
}
void