CERTCertificate *cert2 = STAN_GetCERTCertificate(ct); if (!cert2) { return NULL; } CERT_DestroyCertificate(cert2);
CERT_DestroyCertificate(STAN_GetCERTCertificateOrRelease(ct));
CERT_FindCertByNickname(CERTCertDBHandle *handle, char *nickname){    NSSCryptoContext *cc;    NSSCertificate *c, *ct;    CERTCertificate *cert;    NSSUsage usage;    usage.anyUsage = PR_TRUE;    cc = STAN_GetDefaultCryptoContext();    ct = NSSCryptoContext_FindBestCertificateByNickname(cc, nickname,                                                        NULL, &usage, NULL);    cert = PK11_FindCertFromNickname(nickname, NULL);    c = NULL;    if (cert) {	c = get_best_temp_or_perm(ct, STAN_GetNSSCertificate(cert));	CERT_DestroyCertificate(cert);	if (ct) {	    CERTCertificate *cert2 = STAN_GetCERTCertificate(ct);            if (!cert2) {                return NULL;            }	    CERT_DestroyCertificate(cert2);	}    } else {	c = ct;    }    if (c) {	return STAN_GetCERTCertificate(c);    } else {	return NULL;    }}