Bug 518446: Fix the leak of a CERTSubjectPublicKeyInfo and remove a

redundant null pointer check in PK11_DEREncodePublicKey.  r=rrelyea.


git-svn-id: svn://10.0.0.236/trunk@258492 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
wtc%google.com 2009-09-25 01:35:39 +00:00
parent eb1c236828
commit b1d5a50791

View File

@ -1897,10 +1897,6 @@ PK11_DEREncodePublicKey(SECKEYPublicKey *pubk)
CERTSubjectPublicKeyInfo *spki=NULL;
SECItem *spkiDER = NULL;
if( pubk == NULL ) {
return NULL;
}
/* get the subjectpublickeyinfo */
spki = SECKEY_CreateSubjectPublicKeyInfo(pubk);
if( spki == NULL ) {
@ -1911,6 +1907,8 @@ PK11_DEREncodePublicKey(SECKEYPublicKey *pubk)
spkiDER = SEC_ASN1EncodeItem(NULL /*arena*/, NULL/*dest*/, spki,
CERT_SubjectPublicKeyInfoTemplate);
SECKEY_DestroySubjectPublicKeyInfo(spki);
finish:
return spkiDER;
}