From 09ee19e72b0ed7fa7ad1de752af53c04028240ea Mon Sep 17 00:00:00 2001 From: Davide Beatrici Date: Thu, 10 Jan 2019 22:56:13 +0100 Subject: [PATCH] Mayaqua/Network.c: fix double free crash in GetCipherList() SSL_free() also frees the associated context. https://github.com/openssl/openssl/blob/d6c3c1896cf3c0d69bc27da923d63f8130b13ca0/ssl/ssl_lib.c#L1209 From https://www.openssl.org/docs/man1.1.1/man3/SSL_free.html: "SSL_free() also calls the free()ing procedures for indirectly affected items, if applicable: the buffering BIO, the read and write BIOs, cipher lists specially created for this ssl, the SSL_SESSION. Do not explicitly free these indirectly freed up items before or after calling SSL_free(), as trying to free things twice may lead to program failure." --- src/Mayaqua/Network.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Mayaqua/Network.c b/src/Mayaqua/Network.c index 5667814b..44ed72b5 100644 --- a/src/Mayaqua/Network.c +++ b/src/Mayaqua/Network.c @@ -16507,7 +16507,6 @@ TOKEN_LIST *GetCipherList() } sk_SSL_CIPHER_free(sk); - FreeSSLCtx(ctx); SSL_free(ssl); return ciphers;