diff options
author | wtchang%redhat.com <devnull@localhost> | 2005-03-16 21:57:47 +0000 |
---|---|---|
committer | wtchang%redhat.com <devnull@localhost> | 2005-03-16 21:57:47 +0000 |
commit | 3792f3db2ca80bf0bc10829616593a7afe146613 (patch) | |
tree | 15eac337a5c1648088b096f1943c526cafd2aadb /security | |
parent | e678e9da8e60c3b4076ae6f615c67ef781878f29 (diff) | |
download | nss-hg-3792f3db2ca80bf0bc10829616593a7afe146613.tar.gz |
Bugzilla Bug 286313: code cleanup: use PORT_New and PORT_ZNew to allocate
structures. r=nelsonb.
Diffstat (limited to 'security')
-rw-r--r-- | security/nss/lib/pk11wrap/pk11skey.c | 8 |
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; |