nsCRT::memset(*data, 0, (n + 1) * sizeof(nsMsgAttachmentData));
memset(*data, 0, (n + 1) * sizeof(nsMsgAttachmentData));
ProcessBodyAsAttachment(MimeObject *obj, nsMsgAttachmentData **data){  nsMsgAttachmentData   *tmp;  PRInt32               n;  char                  *disp = nsnull;  char                  *charset = nsnull;  // Ok, this is the special case when somebody sends an "attachment" as the body  // of an RFC822 message...I really don't think this is the way this should be done.  // I belive this should really be a multipart/mixed message with an empty body part,  // but what can ya do...our friends to the North seem to do this.  //  MimeObject    *child = obj;  n = 1;  *data = (nsMsgAttachmentData *)PR_Malloc( (n + 1) * sizeof(nsMsgAttachmentData));  if (!*data)     return NS_ERROR_OUT_OF_MEMORY;  tmp = *data;  nsCRT::memset(*data, 0, (n + 1) * sizeof(nsMsgAttachmentData));  tmp->real_type = child->content_type ? nsCRT::strdup(child->content_type) : NULL;  tmp->real_encoding = child->encoding ? nsCRT::strdup(child->encoding) : NULL;  disp = MimeHeaders_get(child->headers, HEADER_CONTENT_DISPOSITION, PR_FALSE, PR_FALSE);  tmp->real_name = MimeHeaders_get_parameter(disp, "name", &charset, NULL);  if (tmp->real_name)  {    char *fname = NULL;    fname = mime_decode_filename(tmp->real_name, charset, obj->options);    PR_FREEIF(charset);    if (fname && fname != tmp->real_name)    {      PR_Free(tmp->real_name);      tmp->real_name = fname;    }  }  else  {    tmp->real_name = MimeHeaders_get_name(child->headers, obj->options);  }  if ( (!tmp->real_name) && (tmp->real_type) && (nsCRT::strncasecmp(tmp->real_type, "text", 4)) )    ValidateRealName(tmp, child->headers);  char  *tmpURL = nsnull;  char  *id = nsnull;  char  *id_imap = nsnull;  id = mime_part_address (obj);  if (obj->options->missing_parts)    id_imap = mime_imap_part_address (obj);  if (! id)  {    PR_FREEIF(*data);    PR_FREEIF(id_imap);    return NS_ERROR_OUT_OF_MEMORY;  }  if (obj->options && obj->options->url)  {    const char  *url = obj->options->url;    nsresult    rv;    if (id_imap && id)    {      // if this is an IMAP part.       tmpURL = mime_set_url_imap_part(url, id_imap, id);      rv = nsMimeNewURI(&(tmp->url), tmpURL, nsnull);      tmp->notDownloaded = PR_TRUE;    }    else    {      // This is just a normal MIME part as usual.       tmpURL = mime_set_url_part(url, id, PR_TRUE);      rv = nsMimeNewURI(&(tmp->url), tmpURL, nsnull);    }    if ( (!tmp->url) || (NS_FAILED(rv)) )    {      PR_FREEIF(*data);      PR_FREEIF(id);      PR_FREEIF(id_imap);      return NS_ERROR_OUT_OF_MEMORY;    }  }  PR_FREEIF(id);  PR_FREEIF(id_imap);  PR_FREEIF(tmpURL);  tmp->description = MimeHeaders_get(child->headers, HEADER_CONTENT_DESCRIPTION, PR_FALSE, PR_FALSE);  return NS_OK;}