Fix memory leak when using hardware acceleraters.

This commit is contained in:
relyea%netscape.com 2000-06-29 21:26:17 +00:00
parent 1d084af74a
commit 2c08b2ae6c

View File

@ -2780,13 +2780,17 @@ pk11_AnyUnwrapKey(PK11SlotInfo *slot, CK_OBJECT_HANDLE wrappingKey,
symKey = pk11_HandUnwrap(slot, wrappingKey, &mechanism, wrappedKey,
target, keyTemplate, templateCount, keySize,
wincx);
if (symKey) return symKey;
if (symKey) {
if (param_free) SECITEM_FreeItem(param_free,PR_TRUE);
return symKey;
}
/* fall through, maybe they incorrectly set CKF_DECRYPT */
}
/* get our key Structure */
symKey = PK11_CreateSymKey(slot,target,wincx);
if (symKey == NULL) {
if (param_free) SECITEM_FreeItem(param_free,PR_TRUE);
return NULL;
}