From 7b3eebe6f8cde42b78ae668ab29ea254f38fbcd6 Mon Sep 17 00:00:00 2001 From: Nokis Mavrogiannopoulos Date: Mon, 20 Jul 2009 20:39:22 +0000 Subject: only call gnutls_bye on non null gnutls session. --- src/gnutls_io.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/gnutls_io.c b/src/gnutls_io.c index b06afd7..a8fd242 100644 --- a/src/gnutls_io.c +++ b/src/gnutls_io.c @@ -544,9 +544,11 @@ apr_status_t mgs_filter_output(ap_filter_t * f, while (!APR_BRIGADE_EMPTY(bb)) { apr_bucket *bucket = APR_BRIGADE_FIRST(bb); if (AP_BUCKET_IS_EOC(bucket)) { - do { - ret = gnutls_bye( ctxt->session, GNUTLS_SHUT_WR); - } while(ret == GNUTLS_E_INTERRUPTED || ret == GNUTLS_E_AGAIN); + if (ctxt->session != NULL) { + do { + ret = gnutls_bye( ctxt->session, GNUTLS_SHUT_WR); + } while(ret == GNUTLS_E_INTERRUPTED || ret == GNUTLS_E_AGAIN); + } apr_bucket_copy(bucket, &e); APR_BRIGADE_INSERT_TAIL(ctxt->output_bb, e); -- cgit