bug 635705 - reorder code in GetParameterInternal. r+a=bzbarsky

This commit is contained in:
Jonathan Kew 2011-02-23 07:29:26 +00:00
parent 9983401c5c
commit 12610868a7

View File

@ -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;
}