NS_ENSURE_TRUE(inBuf, NS_ERROR_OUT_OF_MEMORY);   char* convertedBuf = nsLinebreakConverter::ConvertLineBreaks(inBuf, nsLinebreakConverter::eLinebreakAny, nsLinebreakConverter::eLinebreakNet); nsMemory::Free(inBuf);  char* escapedBuf = nsEscape(convertedBuf, url_XPAlphas); nsMemory::Free(convertedBuf);
char* escapedBuf = nsEscape(encodedBuf.get(), url_XPAlphas); NS_ENSURE_TRUE(escapedBuf, NS_ERROR_OUT_OF_MEMORY);
nsFSURLEncoded::URLEncode(const nsAString& aStr, nsCString& aEncoded){  char* inBuf = EncodeVal(aStr);  if (!inBuf)    inBuf = ToNewCString(aStr);  NS_ENSURE_TRUE(inBuf, NS_ERROR_OUT_OF_MEMORY);  // convert to CRLF breaks  char* convertedBuf = nsLinebreakConverter::ConvertLineBreaks(inBuf,                           nsLinebreakConverter::eLinebreakAny,                           nsLinebreakConverter::eLinebreakNet);  nsMemory::Free(inBuf);  char* escapedBuf = nsEscape(convertedBuf, url_XPAlphas);  nsMemory::Free(convertedBuf);  aEncoded.Adopt(escapedBuf);  return NS_OK;}