From 33f5a2c2f9eb4ff145df00944d8561fcf95866c7 Mon Sep 17 00:00:00 2001 From: Luke Bratch Date: Tue, 21 May 2019 20:41:54 +0100 Subject: Only do SSL_free() in disconnectclient() if using client TLS. --- blabouncer.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'blabouncer.c') diff --git a/blabouncer.c b/blabouncer.c index 78ddd9f..520341d 100644 --- a/blabouncer.c +++ b/blabouncer.c @@ -282,8 +282,10 @@ int disconnectclient(int fd, struct client *clients, struct ircdstrings *ircdstr clients[i].pendingwhois = 0; clients[i].pendingwhowas = 0; clients[i].pendingnames = 0; - // Finish up with OpenSSL - SSL_free(clients[i].ssl); + if (settings->clienttls) { + // Finish up with OpenSSL if using client TLS + SSL_free(clients[i].ssl); + } // Close the socket close(fd); // Now clients array is cleared, inform all other clients (source "0" since we trust this message) -- cgit v1.2.3