dest = (SECItem *) PORT_ArenaZAlloc(arena, sizeof(SECItem));
dest = PORT_ArenaZNew(arena, SECItem); if (!dest) goto loser;
CERT_EncodeGeneralName(CERTGeneralName *genName, SECItem *dest, PRArenaPool *arena){    PORT_Assert(arena);    if (arena == NULL) {	goto loser;    }    if (dest == NULL) {	dest = (SECItem *) PORT_ArenaZAlloc(arena, sizeof(SECItem));    }    switch (genName->type) {      case certURI:          dest = SEC_ASN1EncodeItem(arena, dest, genName, 				    CERT_URITemplate);	  break;      case certRFC822Name:          dest = SEC_ASN1EncodeItem(arena, dest, genName, 				    CERT_RFC822NameTemplate);	  break;      case certDNSName:          dest = SEC_ASN1EncodeItem(arena, dest, genName, 				    CERT_DNSNameTemplate);	  break;      case certIPAddress:	  dest = SEC_ASN1EncodeItem(arena, dest, genName,				    CERT_IPAddressTemplate);	  break;      case certOtherName:	  dest = SEC_ASN1EncodeItem(arena, dest, genName,				    CERTOtherNameTemplate);	  break;      case certRegisterID:	  dest = SEC_ASN1EncodeItem(arena, dest, genName,				    CERT_RegisteredIDTemplate);	  break;      case certEDIPartyName:	  /* for this type, we expect the value is already encoded */	  dest = SEC_ASN1EncodeItem (arena, dest, genName, 				     CERT_EDIPartyNameTemplate);	  break;      case certX400Address:	  /* for this type, we expect the value is already encoded */	  dest = SEC_ASN1EncodeItem (arena, dest, genName, 				     CERT_X400AddressTemplate);	  break;      case certDirectoryName:	  if (genName->derDirectoryName.data == NULL) {	      /* The field hasn't been encoded yet. */	      SECItem * pre_dest =	      SEC_ASN1EncodeItem (arena, &(genName->derDirectoryName),				  &(genName->name.directoryName), 				  CERT_NameTemplate);	      if (!pre_dest)		  goto loser;	  }	  if (genName->derDirectoryName.data == NULL) {	      goto loser;	  }	  dest = SEC_ASN1EncodeItem(arena, dest, genName, 				    CERT_DirectoryNameTemplate);	  break;    }    if (!dest) {	goto loser;    }    return dest;loser:    return NULL;}