bug 635705. r=bzbarsky a=dveditz
authorJonathan Kew <jfkthame@gmail.com>
Sat, 05 Mar 2011 08:30:18 +0000
changeset 27349 f51e2d406a0c6a03516151f2c72c67d8a558da53
parent 27348 442b50206d50283ee528cd06fe98ef471eb5a1e7
child 27350 8c11daae5821ff6090180b9dd057fb8778851385
push id2684
push userjkew@mozilla.com
push dateSat, 05 Mar 2011 08:31:30 +0000
reviewersbzbarsky, dveditz
bugs635705
milestone1.9.1.18pre
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++;