genName = (CERTGeneralName *) PORT_ArenaZAlloc(arena, sizeof(CERTGeneralName));
genName = PORT_ArenaZNew(arena, CERTGeneralName); if (!genName) goto loser;
CERT_DecodeGeneralName(PRArenaPool      *arena,		       SECItem          *encodedName,		       CERTGeneralName  *genName){    CERTGeneralNameType              genNameType;    SECStatus                        rv = SECSuccess;    PORT_Assert(arena);    if (genName == NULL) {	genName = (CERTGeneralName *) PORT_ArenaZAlloc(arena, sizeof(CERTGeneralName));    }    genNameType = (CERTGeneralNameType)((*(encodedName->data) & 0x0f) + 1);    switch (genNameType) {      case certURI:	  rv = SEC_ASN1DecodeItem(arena, genName, CERT_URITemplate, encodedName);	  break;      case certRFC822Name:	  rv = SEC_ASN1DecodeItem(arena, genName, CERT_RFC822NameTemplate, encodedName);	  break;      case certDNSName:	  rv = SEC_ASN1DecodeItem(arena, genName, CERT_DNSNameTemplate, encodedName);	  break;      case certIPAddress:	  rv = SEC_ASN1DecodeItem(arena, genName, CERT_IPAddressTemplate, encodedName);	  break;      case certOtherName:	  rv = SEC_ASN1DecodeItem(arena, genName, CERTOtherNameTemplate, encodedName);	  break;      case certRegisterID:	  rv = SEC_ASN1DecodeItem(arena, genName, CERT_RegisteredIDTemplate, encodedName);	  break;      case certEDIPartyName:	  rv = SEC_ASN1DecodeItem(arena, genName, CERT_EDIPartyNameTemplate, encodedName);	  break;      case certX400Address:	  rv = SEC_ASN1DecodeItem(arena, genName, CERT_X400AddressTemplate, encodedName);	  break;      case certDirectoryName:		rv = SEC_ASN1DecodeItem		     (arena, genName, CERT_DirectoryNameTemplate, encodedName);		if (rv != SECSuccess) {		    goto loser;		}		rv = SEC_ASN1DecodeItem		      (arena, &(genName->name.directoryName), CERT_NameTemplate,		      &(genName->derDirectoryName));	  break;    }    if (rv != SECSuccess) {	goto loser;    }    genName->type = genNameType;    genName->l.next = (PRCList *) ((char *) genName) + offsetof(CERTGeneralName, l);    genName->l.prev = genName->l.next;    return genName;loser:    return NULL;}