From abf66aa7a1cb4d09a967b715ab7f59fc62801aaf Mon Sep 17 00:00:00 2001 From: Matt Johnston Date: Wed, 18 Aug 2004 16:31:05 +0000 Subject: [PATCH] Don't try to remove non-eixtant listeners --HG-- extra : convert_revision : 87058f74626cd6795ecd495cc22779618c70eaa8 --- svr-x11fwd.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/svr-x11fwd.c b/svr-x11fwd.c index a8d1cd5..75e94b8 100644 --- a/svr-x11fwd.c +++ b/svr-x11fwd.c @@ -171,8 +171,12 @@ void x11cleanup(struct ChanSess *chansess) { m_free(chansess->x11authprot); m_free(chansess->x11authcookie); - remove_listener(chansess->x11listener); - chansess->x11listener = NULL; + + TRACE(("chansess %s", chansess)); + if (chansess->x11listener != NULL) { + remove_listener(chansess->x11listener); + chansess->x11listener = NULL; + } } static const struct ChanType chan_x11 = {