summaryrefslogtreecommitdiff
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 c539990f6..04cd6b0a7 100644
--- a/channels.c
+++ b/channels.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: channels.c,v 1.279 2008/06/12 03:40:52 djm Exp $ */ 1/* $OpenBSD: channels.c,v 1.280 2008/06/12 15:19:17 djm Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * 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,
328 c->open_confirm_ctx = NULL; 328 c->open_confirm_ctx = NULL;
329 c->input_filter = NULL; 329 c->input_filter = NULL;
330 c->output_filter = NULL; 330 c->output_filter = NULL;
331 c->filter_ctx = NULL;
332 c->filter_cleanup = NULL;
331 TAILQ_INIT(&c->status_confirms); 333 TAILQ_INIT(&c->status_confirms);
332 debug("channel %d: new [%s]", found, remote_name); 334 debug("channel %d: new [%s]", found, remote_name);
333 return c; 335 return c;
@@ -416,6 +418,8 @@ channel_free(Channel *c)
416 bzero(cc, sizeof(*cc)); 418 bzero(cc, sizeof(*cc));
417 xfree(cc); 419 xfree(cc);
418 } 420 }
421 if (c->filter_cleanup != NULL && c->filter_ctx != NULL)
422 c->filter_cleanup(c->self, c->filter_ctx);
419 channels[c->self] = NULL; 423 channels[c->self] = NULL;
420 xfree(c); 424 xfree(c);
421} 425}
@@ -731,7 +735,7 @@ channel_cancel_cleanup(int id)
731 735
732void 736void
733channel_register_filter(int id, channel_infilter_fn *ifn, 737channel_register_filter(int id, channel_infilter_fn *ifn,
734 channel_outfilter_fn *ofn, void *ctx) 738 channel_outfilter_fn *ofn, channel_filter_cleanup_fn *cfn, void *ctx)
735{ 739{
736 Channel *c = channel_lookup(id); 740 Channel *c = channel_lookup(id);
737 741
@@ -742,6 +746,7 @@ channel_register_filter(int id, channel_infilter_fn *ifn,
742 c->input_filter = ifn; 746 c->input_filter = ifn;
743 c->output_filter = ofn; 747 c->output_filter = ofn;
744 c->filter_ctx = ctx; 748 c->filter_ctx = ctx;
749 c->filter_cleanup = cfn;
745} 750}
746 751
747void 752void