bulletproof fix for crash in mime_parse_stream_complete, r+a=standard8, bug 715810
authorDavid Bienvenu <bienvenu@nventure.com>
Wed, 11 Jan 2012 07:44:09 -0800
changeset 10092 19f2edf25ef9ad622c87dcda61718850d9eab97d
parent 10091 2f1c07cca30f0530bee4be3115529bad39367f55
child 10093 e1158a0f23b0fa7571cbb4523d35e6a63f50ad59
push idunknown
push userunknown
push dateunknown
bugs715810
bulletproof fix for crash in mime_parse_stream_complete, r+a=standard8, bug 715810
mailnews/mime/src/mimedrft.cpp
--- a/mailnews/mime/src/mimedrft.cpp
+++ b/mailnews/mime/src/mimedrft.cpp
@@ -1602,17 +1602,17 @@ mime_parse_stream_complete (nsMIMESessio
 
   //
   // Free the original attachment structure...
   // Make sure we only cleanup the local copy of the memory and not kill
   // files we need on disk
   //
   if (bodyAsAttachment)
     mdd->messageBody->m_tmpFile = nsnull;
-  else if (mdd->messageBody->m_tmpFile)
+  else if (mdd->messageBody && mdd->messageBody->m_tmpFile)
     mdd->messageBody->m_tmpFile->Remove(PR_FALSE);
 
   delete mdd->messageBody;
 
   for (int i = 0; i < mdd->attachments.Length(); i++)
     mdd->attachments[i]->m_tmpFile = nsnull;
 
   PR_FREEIF(mdd->mailcharset);