PR_FREEIF (htmlLine1); PR_FREEIF (htmlLine2); PR_FREEIF (namestring); } } }
PR_FREEIF (htmlLine1); PR_FREEIF (htmlLine2); } } }
static int OutputBasicVcard(MimeObject *obj, VObject *v){	int status = 0;	char * htmlLine1 = NULL;	char * htmlLine2 = NULL;	char * htmlLine = NULL;	VObject *prop = NULL;	VObject* prop2 = NULL;	char * urlstring = NULL;	char * namestring = NULL;	char * emailstring = NULL;	/* get the name and email */	prop = isAPropertyOf(v, VCFullNameProp);	if (prop)	{		if (VALUE_TYPE(prop))		{			if (VALUE_TYPE(prop) != VCVT_RAW)				namestring  = fakeCString (vObjectUStringZValue(prop));			else			{				namestring = (char *)PR_MALLOC(nsCRT::strlen((char *) vObjectAnyValue(prop)) + 1);				if (namestring)					PL_strcpy(namestring, (char *) vObjectAnyValue(prop));			}			if (namestring)			{				prop = isAPropertyOf(v, VCURLProp);				if (prop)				{					urlstring  = fakeCString (vObjectUStringZValue(prop));					if (urlstring)						htmlLine1 = PR_smprintf ("<A HREF=""%s"" PRIVATE>%s</A> ", urlstring, namestring);					else						htmlLine1 = PR_smprintf ("%s ", namestring);					PR_FREEIF (urlstring);				}				else					htmlLine1 = PR_smprintf ("%s ", namestring);				/* get the email address */				prop = isAPropertyOf(v, VCEmailAddressProp);				if (prop)				{					emailstring  = fakeCString (vObjectUStringZValue(prop));					if (emailstring)					{						/* if its an internet address prepend the mailto url */						prop2 = isAPropertyOf(prop, VCInternetProp);						if (prop2)							htmlLine2 = PR_smprintf ("&lt;<A HREF=""mailto:%s"" PRIVATE>%s</A>&gt;", emailstring, emailstring);						else							htmlLine2 = PR_smprintf ("%s", emailstring);						PR_FREEIF (emailstring);					}				}				if (!htmlLine1 && !htmlLine2)				{					PR_FREEIF (htmlLine1);					PR_FREEIF (htmlLine2);					return VCARD_OUT_OF_MEMORY;				}				else				{					htmlLine = NS_MsgSACat (&htmlLine, htmlLine1);					htmlLine = NS_MsgSACat (&htmlLine, htmlLine2);				}				PR_FREEIF (htmlLine1);				PR_FREEIF (htmlLine2);				PR_FREEIF (namestring);			}		}	}	status = OutputTable (obj, PR_FALSE, PR_FALSE, "0", "0", NULL);	if (status < 0) {		PR_FREEIF (htmlLine); 		return status;	}	if (htmlLine)	{		status = OutputTableRowOrData(obj, PR_TRUE, PR_FALSE, "LEFT", "TOP", NULL, NULL);		if (status < 0) {			PR_Free (htmlLine);			return status;		}		status = OutputTableRowOrData (obj, PR_FALSE, PR_FALSE, NULL, NULL, NULL, NULL);		if (status < 0) {			PR_Free (htmlLine);			return status;		}		status = WriteLineToStream (obj, htmlLine, PR_TRUE);		PR_Free (htmlLine); 		if (status < 0) return status;		status = OutputTableRowOrData (obj, PR_FALSE, PR_TRUE, NULL, NULL, NULL, NULL);		if (status < 0) return status;		status = OutputTableRowOrData(obj, PR_TRUE, PR_TRUE, NULL, NULL, NULL, NULL);		if (status < 0) return status;	}	else		status = VCARD_OUT_OF_MEMORY;	status = OutputTableRowOrData(obj, PR_TRUE, PR_FALSE, NULL, NULL, NULL, NULL);	if (status < 0) return status;	status = OutputTableRowOrData (obj, PR_FALSE, PR_FALSE, NULL, NULL, NULL, NULL);	if (status < 0) return status;	/* output the title */	status = OutputVcardAttribute (obj, v, VCTitleProp);	if (status < 0) return status;	/* write out the org name and company name */	prop = isAPropertyOf(v, VCOrgProp);	if (prop)	{		status = OutputVcardAttribute (obj, prop, VCOrgNameProp);		if (status < 0) return status;		status = OutputVcardAttribute (obj, prop, VCOrgUnitProp);		if (status < 0) return status;		status = OutputVcardAttribute (obj, prop, VCOrgUnit2Prop);		if (status < 0) return status;		status = OutputVcardAttribute (obj, prop, VCOrgUnit3Prop);		if (status < 0) return status;	}	status = OutputTableRowOrData (obj, PR_FALSE, PR_TRUE, NULL, NULL, NULL, NULL);	if (status < 0) return status;	status = OutputTableRowOrData (obj, PR_TRUE, PR_TRUE, NULL, NULL, NULL, NULL);	if (status < 0) return status;	status = OutputTable (obj, PR_TRUE, PR_FALSE, NULL, NULL, NULL);	if (status < 0) return status;	return 0;}