bug 635705. r=bzbarsky a=dveditz
authorJonathan Kew <jfkthame@gmail.com>
Sat, 05 Mar 2011 08:37:32 +0000
changeset 34971 eaca9531b26317cbea5d00f5a53169bbd034bdc5
parent 34968 60b1c062d1462a364a4f5552c980256a14a476e2
child 34972 925f4985ee729dbda580c789614f7913cdadc482
push id1845
push userjkew@mozilla.com
push dateSat, 05 Mar 2011 08:38:26 +0000
reviewersbzbarsky, dveditz
bugs635705
milestone1.9.2.16pre
bug 635705. r=bzbarsky a=dveditz
netwerk/mime/src/nsMIMEHeaderParamImpl.cpp
--- a/netwerk/mime/src/nsMIMEHeaderParamImpl.cpp
+++ b/netwerk/mime/src/nsMIMEHeaderParamImpl.cpp
@@ -160,18 +160,18 @@ nsMIMEHeaderParamImpl::GetParameterInter
   // Content-Disposition: inline; filename=.....
   if (!aParamName || !*aParamName) 
     {
       for (; *str && *str != ';' && !nsCRT::IsAsciiSpace(*str); ++str)
         ;
       if (str == start)
         return NS_ERROR_UNEXPECTED;
       *aResult = (char *) nsMemory::Clone(start, (str - start) + 1);
+      NS_ENSURE_TRUE(*aResult, NS_ERROR_OUT_OF_MEMORY);
       (*aResult)[str - start] = '\0';  // null-terminate
-      NS_ENSURE_TRUE(*aResult, NS_ERROR_OUT_OF_MEMORY);
       return NS_OK;
     }
 
   /* Skip forward to first ';' */
   for (; *str && *str != ';' && *str != ','; ++str)
     ;
   if (*str)
     str++;