summaryrefslogtreecommitdiff
path: root/security/nss
diff options
context:
space:
mode:
authorwtchang%redhat.com <devnull@localhost>2005-03-16 21:57:47 +0000
committerwtchang%redhat.com <devnull@localhost>2005-03-16 21:57:47 +0000
commit3792f3db2ca80bf0bc10829616593a7afe146613 (patch)
tree15eac337a5c1648088b096f1943c526cafd2aadb /security/nss
parente678e9da8e60c3b4076ae6f615c67ef781878f29 (diff)
downloadnss-hg-3792f3db2ca80bf0bc10829616593a7afe146613.tar.gz
Bugzilla Bug 286313: code cleanup: use PORT_New and PORT_ZNew to allocate
structures. r=nelsonb.
Diffstat (limited to 'security/nss')
-rw-r--r--security/nss/lib/pk11wrap/pk11skey.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/security/nss/lib/pk11wrap/pk11skey.c b/security/nss/lib/pk11wrap/pk11skey.c
index c34ed29ba..169efeae8 100644
--- a/security/nss/lib/pk11wrap/pk11skey.c
+++ b/security/nss/lib/pk11wrap/pk11skey.c
@@ -88,7 +88,7 @@ pk11_getKeyFromList(PK11SlotInfo *slot) {
return symKey;
}
- symKey = (PK11SymKey *)PORT_Alloc(sizeof(PK11SymKey));
+ symKey = PORT_New(PK11SymKey);
if (symKey == NULL) {
return NULL;
}
@@ -1450,8 +1450,7 @@ PK11_PubDerive(SECKEYPrivateKey *privKey, SECKEYPublicKey *pubKey,
symKey->size = keySize;
if (key_size == 0) templateCount--;
- mechParams = (CK_ECDH1_DERIVE_PARAMS *)
- PORT_ZAlloc(sizeof(CK_ECDH1_DERIVE_PARAMS));
+ mechParams = PORT_ZNew(CK_ECDH1_DERIVE_PARAMS);
mechParams->kdf = CKD_SHA1_KDF;
mechParams->ulSharedDataLen = 0;
mechParams->pSharedData = NULL;
@@ -1547,8 +1546,7 @@ PK11_PubDeriveWithKDF(SECKEYPrivateKey *privKey, SECKEYPublicKey *pubKey,
symKey->size = keySize;
if (key_size == 0) templateCount--;
- mechParams = (CK_ECDH1_DERIVE_PARAMS *)
- PORT_ZAlloc(sizeof(CK_ECDH1_DERIVE_PARAMS));
+ mechParams = PORT_ZNew(CK_ECDH1_DERIVE_PARAMS);
if ((kdf < CKD_NULL) || (kdf > CKD_SHA1_KDF)) {
PORT_SetError(SEC_ERROR_INVALID_ALGORITHM);
break;