current = (CERTGeneralName *) PORT_ArenaAlloc(arena, sizeof (CERTGeneralName));
current = PORT_ArenaZNew(arena, CERTGeneralName);
GetGeneralName (PRArenaPool *arena){    CERTGeneralName *namesList = NULL;    CERTGeneralName *current;    CERTGeneralName *tail = NULL;    SECStatus rv = SECSuccess;    int intValue;    char buffer[512];    void *mark;    PORT_Assert (arena);    mark = PORT_ArenaMark (arena);    do {	puts ("\nSelect one of the following general name type: \n");	puts ("\t1 - instance of other name\n\t2 - rfc822Name\n\t3 - dnsName\n");	puts ("\t4 - x400Address\n\t5 - directoryName\n\t6 - ediPartyName\n");	puts ("\t7 - uniformResourceidentifier\n\t8 - ipAddress\n\t9 - registerID\n");	puts ("\tOther - omit\n\t\tChoice:");	if (scanf ("%d", &intValue) == EOF) {	    PORT_SetError(SEC_ERROR_INPUT_LEN);            GEN_BREAK (SECFailure);        }	if (intValue >= certOtherName || intValue <= certRegisterID) {	    if (namesList == NULL) {		namesList = current = tail = (CERTGeneralName *) PORT_ArenaAlloc 		                                  (arena, sizeof (CERTGeneralName));	    } else {		current = (CERTGeneralName *) PORT_ArenaAlloc(arena, 							      sizeof (CERTGeneralName));	    }	    if (current == NULL) {		GEN_BREAK (SECFailure);	    }		} else {	    break;	}	current->type = intValue;	puts ("\nEnter data:");	fflush (stdout);	if (gets (buffer) == NULL) {	    PORT_SetError(SEC_ERROR_INPUT_LEN);            GEN_BREAK (SECFailure);        }	switch (current->type) {	    case certURI:	    case certDNSName:	    case certRFC822Name:		current->name.other.data = PORT_ArenaAlloc (arena, strlen (buffer));		if (current->name.other.data == NULL) {		    GEN_BREAK (SECFailure);		}		PORT_Memcpy		  (current->name.other.data, buffer, current->name.other.len = strlen(buffer));		break;	    case certEDIPartyName:	    case certIPAddress:	    case certOtherName:	    case certRegisterID:	    case certX400Address: {		current->name.other.data = PORT_ArenaAlloc (arena, strlen (buffer) + 2);		if (current->name.other.data == NULL) {		    GEN_BREAK (SECFailure);		}		PORT_Memcpy (current->name.other.data + 2, buffer, strlen (buffer));		/* This may not be accurate for all cases.  For now, use this tag type */		current->name.other.data[0] = (char)(((current->type - 1) & 0x1f)| 0x80);		current->name.other.data[1] = (char)strlen (buffer);		current->name.other.len = strlen (buffer) + 2;		break;	    }	    case certDirectoryName: {		CERTName *directoryName = NULL;		directoryName = CERT_AsciiToName (buffer);		if (!directoryName) {		    fprintf(stderr, "certutil: improperly formatted name: \"%s\"\n", buffer);		    break;		}			    		rv = CERT_CopyName (arena, &current->name.directoryName, directoryName);		CERT_DestroyName (directoryName);				break;	    }	}	if (rv != SECSuccess)	    break;	current->l.next = &(namesList->l);	current->l.prev = &(tail->l);	tail->l.next = &(current->l);	tail = current;    }while (1);    if (rv != SECSuccess) {	PORT_ArenaRelease (arena, mark);	namesList = NULL;    }    return (namesList);}