[pkg-opensc-commit] [libp11] 66/239: fix memory leak: free _private data as well when destroying a cert/key object

Eric Dorland eric at moszumanska.debian.org
Sat Oct 17 06:21:09 UTC 2015


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

eric pushed a commit to branch master
in repository libp11.

commit b8e8696173f391364e94f3913efb08bcea026ad7
Author: Nils Larsch <nlarsch at gmx.net>
Date:   Sat Oct 22 12:11:59 2005 +0000

    fix memory leak: free _private data as well when destroying a cert/key object
---
 src/p11_cert.c | 2 ++
 src/p11_key.c  | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/src/p11_cert.c b/src/p11_cert.c
index ce3357c..02c945a 100644
--- a/src/p11_cert.c
+++ b/src/p11_cert.c
@@ -208,6 +208,8 @@ void pkcs11_destroy_certs(PKCS11_TOKEN * token)
 		OPENSSL_free(cert->label);
 		if (cert->id)
 			free(cert->id);
+		if (cert->_private != NULL)
+			OPENSSL_free(cert->_private);
 	}
 	if (priv->certs)
 		OPENSSL_free(priv->certs);
diff --git a/src/p11_key.c b/src/p11_key.c
index af4d6ce..3cac2b2 100644
--- a/src/p11_key.c
+++ b/src/p11_key.c
@@ -306,6 +306,8 @@ void pkcs11_destroy_keys(PKCS11_TOKEN * token)
 		OPENSSL_free(key->label);
 		if (key->id)
 			free(key->id);
+		if (key->_private != NULL)
+			OPENSSL_free(key->_private);
 	}
 	if (priv->keys)
 		OPENSSL_free(priv->keys);

-- 
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