Bug 165859: fixed the problem that 'collection' was destroyed twice on
authorwtc%netscape.com
Sat, 31 Aug 2002 04:52:46 +0000
changeset 3529 d75cd02070ac04685467d82d8fd3967fe7ac8edc
parent 3524 34b69743fed093792805f20eff188c7f3c49b510
child 3533 34a78195b82663c77bbe336d23a5b582403283f0
push idunknown
push userunknown
push dateunknown
bugs165859
Bug 165859: fixed the problem that 'collection' was destroyed twice on error in nssTrustDomain_FindCertificateByIssuerAndSerialNumber.
security/nss/lib/pki/trustdomain.c
--- a/security/nss/lib/pki/trustdomain.c
+++ b/security/nss/lib/pki/trustdomain.c
@@ -829,20 +829,20 @@ nssTrustDomain_FindCertificateByIssuerAn
 		nssPKIObjectCollection_AddInstances(collection, 
 		                                    &instance, 1);
 	    }
 	}
     }
     if (collection) {
 	(void)nssPKIObjectCollection_GetCertificates(collection, 
 	                                             &rvCert, 1, NULL);
-	nssPKIObjectCollection_Destroy(collection);
 	if (!rvCert) {
 	    goto loser;
 	}
+	nssPKIObjectCollection_Destroy(collection);
     }
     nssSlotArray_Destroy(slots);
     return rvCert;
 loser:
     if (collection) {
 	nssPKIObjectCollection_Destroy(collection);
     }
     if (slots) {