summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrelyea%netscape.com <devnull@localhost>2000-06-29 21:26:17 +0000
committerrelyea%netscape.com <devnull@localhost>2000-06-29 21:26:17 +0000
commit3353e27a3c484002cd925ce3837b1875ac54b5eb (patch)
tree0cc059b77ac529c0c1e17d29cd9bb783030196ef
parente5df4b94eb1f23197dbfcd353cdb3a578d346dac (diff)
downloadnss-hg-3353e27a3c484002cd925ce3837b1875ac54b5eb.tar.gz
Fix memory leak when using hardware acceleraters.
-rw-r--r--security/nss/lib/pk11wrap/pk11skey.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/security/nss/lib/pk11wrap/pk11skey.c b/security/nss/lib/pk11wrap/pk11skey.c
index e48c88a6d..4d65b15a8 100644
--- a/security/nss/lib/pk11wrap/pk11skey.c
+++ b/security/nss/lib/pk11wrap/pk11skey.c
@@ -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;
}