bug 635705 - reorder code in GetParameterInternal. r+a=bzbarsky
authorJonathan Kew <jfkthame@gmail.com>
Wed, 23 Feb 2011 07:29:26 +0000
changeset 62987 f8279991d58f712441d13851c817065a3184de62
parent 62986 f011b244508d16c2a8e96ce0008225477896ba15
child 62988 4653a9f587612985c319b71f3f3b260af7aae66b
push id18975
push userjkew@mozilla.com
push dateWed, 23 Feb 2011 07:30:15 +0000
treeherdermozilla-central@f8279991d58f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs635705
milestone2.0b13pre
first release with
nightly linux32
f8279991d58f / 4.0b13pre / 20110223030416 / files
nightly linux64
f8279991d58f / 4.0b13pre / 20110223030416 / files
nightly mac
f8279991d58f / 4.0b13pre / 20110223030416 / files
nightly win32
f8279991d58f / 4.0b13pre / 20110223030416 / files
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
bug 635705 - reorder code in GetParameterInternal. r+a=bzbarsky
netwerk/mime/nsMIMEHeaderParamImpl.cpp
--- a/netwerk/mime/nsMIMEHeaderParamImpl.cpp
+++ b/netwerk/mime/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++;