aboutsummaryrefslogtreecommitdiff
path: root/pkey.rs
diff options
context:
space:
mode:
Diffstat (limited to 'pkey.rs')
-rw-r--r--pkey.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/pkey.rs b/pkey.rs
index 0c6e807a..2da84458 100644
--- a/pkey.rs
+++ b/pkey.rs
@@ -336,6 +336,14 @@ impl PKey {
}
}
+impl Drop for PKey {
+ fn drop(&self) {
+ unsafe {
+ libcrypto::EVP_PKEY_free(self.evp);
+ }
+ }
+}
+
#[cfg(test)]
mod tests {
use super::*;