aboutsummaryrefslogtreecommitdiff
path: root/openssl/src
diff options
context:
space:
mode:
authorGeoffroy Couprie <[email protected]>2015-12-03 12:26:55 +0100
committerGeoffroy Couprie <[email protected]>2015-12-03 12:26:55 +0100
commit6850c810d32a11330c9b1dd4889b447fa8434c36 (patch)
tree71cba316629d2b8ba9c22a9be10acc2d4a99a9e2 /openssl/src
parentMake shims for SSL_CTX_ctrl and SSL_CTX_callback_ctrl macro wrappers (diff)
downloadrust-openssl-6850c810d32a11330c9b1dd4889b447fa8434c36.tar.xz
rust-openssl-6850c810d32a11330c9b1dd4889b447fa8434c36.zip
Increment SSL_CTX's reference count in Ssl::get_ssl_context()
Without this, whenever the returned SslContext is released, the refcount of the underlying SSL_CTX will decrease and it will be freed too soon
Diffstat (limited to 'openssl/src')
-rw-r--r--openssl/src/ssl/mod.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/openssl/src/ssl/mod.rs b/openssl/src/ssl/mod.rs
index b25e7d28..a2096f41 100644
--- a/openssl/src/ssl/mod.rs
+++ b/openssl/src/ssl/mod.rs
@@ -995,6 +995,7 @@ impl Ssl {
/// obtain the context corresponding to the current connection
pub fn get_ssl_context(&self) -> SslContext {
let ssl_ctx = unsafe { ffi::SSL_get_SSL_CTX(self.ssl) };
+ let count = unsafe { ffi_extras::SSL_CTX_increment_refcount(ssl_ctx) };
SslContext { ctx: ssl_ctx }
}
}