if (processedValue) { encodedVal = EncodeVal(*processedValue); delete processedValue; } else { encodedVal = EncodeVal(aValue); } if (!encodedVal) { return NS_ERROR_OUT_OF_MEMORY; } aProcessedValue.Adopt(encodedVal);
nsFSMultipartFormData::ProcessAndEncode(nsIDOMHTMLElement* aSource,                                        const nsAString& aName,                                        const nsAString& aValue,                                        nsCString& aProcessedName,                                        nsCString& aProcessedValue){  //  // Let external code process (and possibly change) value  //  nsString* processedValue = ProcessValue(aSource, aName, aValue);  //  // Get name  //  char * encodedVal = EncodeVal(aName);  if (!encodedVal) {    delete processedValue;    return NS_ERROR_OUT_OF_MEMORY;  }  aProcessedName.Adopt(encodedVal);  //  // Get value  //  if (processedValue) {    encodedVal = EncodeVal(*processedValue);    delete processedValue;  } else {    encodedVal = EncodeVal(aValue);  }  if (!encodedVal) {    return NS_ERROR_OUT_OF_MEMORY;  }  aProcessedValue.Adopt(encodedVal);  //  // Convert linebreaks in value  //  aProcessedValue.Adopt(nsLinebreakConverter::ConvertLineBreaks(aProcessedValue.get(),                        nsLinebreakConverter::eLinebreakAny,                        nsLinebreakConverter::eLinebreakNet));  return NS_OK;}