From: Jonathan Kew <jfkthame@gmail.com>
Date: Sat, 5 Mar 2011 08:30:18 +0000
Subject: bug 635705. r=bzbarsky a=dveditz

---
 netwerk/mime/src/nsMIMEHeaderParamImpl.cpp |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/netwerk/mime/src/nsMIMEHeaderParamImpl.cpp b/netwerk/mime/src/nsMIMEHeaderParamImpl.cpp
index 58dbc80..5409653 100644
--- a/netwerk/mime/src/nsMIMEHeaderParamImpl.cpp
+++ b/netwerk/mime/src/nsMIMEHeaderParamImpl.cpp
@@ -165,8 +165,8 @@ nsMIMEHeaderParamImpl::GetParameterInternal(const char *aHeaderValue,
       if (str == start)
         return NS_ERROR_UNEXPECTED;
       *aResult = (char *) nsMemory::Clone(start, (str - start) + 1);
-      (*aResult)[str - start] = '\0';  // null-terminate
       NS_ENSURE_TRUE(*aResult, NS_ERROR_OUT_OF_MEMORY);
+      (*aResult)[str - start] = '\0';  // null-terminate
       return NS_OK;
     }
 
