[pkg-opensc-commit] [libp11] 06/51: Fixed an EVP_PKEY refcount leak

Eric Dorland eric at moszumanska.debian.org
Wed Dec 7 17:51:30 UTC 2016


This is an automated email from the git hooks/post-receive script.

eric pushed a commit to branch master
in repository libp11.

commit 86114d8a50b22feb2557f215eb9d0df96a4aafb4
Author: Michał Trojnara <Michal.Trojnara at stunnel.org>
Date:   Fri Sep 30 02:44:17 2016 +0200

    Fixed an EVP_PKEY refcount leak
    
    fixes #111
---
 NEWS          | 1 +
 src/p11_rsa.c | 5 ++++-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/NEWS b/NEWS
index 43c00db..870cc5a 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,7 @@ NEWS for Libp11 -- History of user visible changes
 
 New in 0.4.3; unreleased
 * Use UI to get the CKA_ALWAYS_AUTHENTICATE PIN (Michał Trojnara).
+* Fixed an EVP_PKEY refcount leak (David Woodhouse).
 
 New in 0.4.2; 2016-09-25; Michał Trojnara
 * Fixed a 0.4.0 regression bug causing the engine finish function to
diff --git a/src/p11_rsa.c b/src/p11_rsa.c
index dddfc5c..6748746 100644
--- a/src/p11_rsa.c
+++ b/src/p11_rsa.c
@@ -36,9 +36,12 @@ static int rsa_ex_index = 0;
 static RSA *pkcs11_rsa(PKCS11_KEY *key)
 {
 	EVP_PKEY *evp_key = pkcs11_get_key(key, key->isPrivate);
+	RSA *rsa;
 	if (evp_key == NULL)
 		return NULL;
-	return EVP_PKEY_get0_RSA(evp_key);
+	rsa = EVP_PKEY_get0_RSA(evp_key);
+	EVP_PKEY_free(evp_key);
+	return rsa;
 }
 
 /* PKCS#1 v1.5 RSA signature */

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-opensc/libp11.git



More information about the pkg-opensc-commit mailing list