From c05a8bb001e24da956adf3146728e8ef5a028297 Mon Sep 17 00:00:00 2001 From: Nikos 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(-) 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