[pkg-opensc-commit] [pkcs11-helper] 55/253: More cleanups

Eric Dorland eric at moszumanska.debian.org
Fri Jan 6 23:39:04 UTC 2017


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

eric pushed a commit to branch master
in repository pkcs11-helper.

commit 7e2520093b90b68fe2fa9b502aed05970e64239e
Author: Alon Bar-Lev <alon.barlev at gmail.com>
Date:   Sat Dec 23 23:11:53 2006 +0000

    More cleanups
---
 lib/pkcs11h-certificate.c | 30 +++++++++++++++++++++---------
 1 file changed, 21 insertions(+), 9 deletions(-)

diff --git a/lib/pkcs11h-certificate.c b/lib/pkcs11h-certificate.c
index 9d2dd8b..1800eec 100644
--- a/lib/pkcs11h-certificate.c
+++ b/lib/pkcs11h-certificate.c
@@ -314,19 +314,31 @@ __pkcs11h_certificate_loadCertificate (
 					_pkcs11h_mem_free ((void *)&certificate->id->certificate_blob);
 				}
 
-				rv = _pkcs11h_mem_duplicate (
-					(void*)&certificate->id->certificate_blob,
-					&certificate->id->certificate_blob_size,
-					attrs[0].pValue,
-					attrs[0].ulValueLen
-				);
+				if (
+					(rv = _pkcs11h_mem_duplicate (
+						(void*)&certificate->id->certificate_blob,
+						&certificate->id->certificate_blob_size,
+						attrs[0].pValue,
+						attrs[0].ulValueLen
+					)) != CKR_OK
+				) {
+					goto retry1;
+				}
 			}
 		}
 
+		rv = CKR_OK;
+
+	retry1:
+
 		_pkcs11h_session_freeObjectAttributes (
 			attrs,
 			sizeof (attrs) / sizeof (CK_ATTRIBUTE)
 		);
+
+		if (rv != CKR_OK) {
+			goto cleanup;
+		}
 	}
 
 	if (certificate->id->certificate_blob == NULL) {
@@ -760,10 +772,10 @@ _pkcs11h_certificate_resetSession (
 		) {
 			goto cleanup;
 		}
+	}
 
-		if ((rv = __pkcs11h_certificate_updateCertificateIdDescription (certificate->id)) != CKR_OK) {
-			goto cleanup;
-		}
+	if ((rv = __pkcs11h_certificate_updateCertificateIdDescription (certificate->id)) != CKR_OK) {
+		goto cleanup;
 	}
 
 	if (!public_only && certificate->key_handle == _PKCS11H_INVALID_OBJECT_HANDLE) {

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



More information about the pkg-opensc-commit mailing list