summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLemonBoy <thatlemon@gmail.com>2017-09-11 16:32:36 +0200
committerLemonBoy <thatlemon@gmail.com>2017-09-11 16:32:36 +0200
commit96d5a4669d696d57a511119963ae5c651346e167 (patch)
tree1eb92e9c3ed6b16a26804054b72bd0e4244ee7af
parent24ad80177b10093544ec07a5d6b3ed4b1bfc6fb8 (diff)
downloadirssi-96d5a4669d696d57a511119963ae5c651346e167.zip
Increment the X509_STORE refcount during the connection
OpenSSL doesn't increment the reference count when the store is assigned to a SSL_CTX.
-rw-r--r--src/core/network-openssl.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/core/network-openssl.c b/src/core/network-openssl.c
index 2054f28a..feb2295d 100644
--- a/src/core/network-openssl.c
+++ b/src/core/network-openssl.c
@@ -510,6 +510,10 @@ static GIOChannel *irssi_ssl_get_iochannel(GIOChannel *handle, int port, SERVER_
g_free(scapath);
verify = TRUE;
} else if (store != NULL) {
+ /* Make sure to increment the refcount every time the store is
+ * used, that's essential not to get it free'd by OpenSSL when
+ * the SSL_CTX is destroyed. */
+ X509_STORE_up_ref(store);
SSL_CTX_set_cert_store(ctx, store);
}