if ( arena ) { PORT_FreeArena(arena, PR_FALSE); }
FindCertByKey(NSSLOWCERTCertDBHandle *handle, SECItem *certKey, PRBool lockdb){    SECItem keyitem;    DBT key;    SECStatus rv;    NSSLOWCERTCertificate *cert = NULL;    PRArenaPool *arena = NULL;    certDBEntryCert *entry;    PRBool locked = PR_FALSE;        arena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE);    if ( arena == NULL ) {	goto loser;    }        rv = EncodeDBCertKey(certKey, arena, &keyitem);    if ( rv != SECSuccess ) {	goto loser;    }        key.data = keyitem.data;    key.size = keyitem.len;        if ( lockdb ) {	locked = PR_TRUE;	nsslowcert_LockDB(handle);    }	    /* find in perm database */    entry = ReadDBCertEntry(handle, certKey);	    if ( entry == NULL ) { 	goto loser;    }      /* inherit entry */      cert = DecodeACert(handle, entry);loser:    if (cert == NULL) {	if (entry) {	    DestroyDBEntry((certDBEntry *)entry);	}    }    if ( locked ) {	nsslowcert_UnlockDB(handle);    }    if ( arena ) {	PORT_FreeArena(arena, PR_FALSE);    }        return(cert);}