passwordRealm = buffer.ToNewCString();
passwordRealm = ToNewCString(buffer);
SI_LoadSignonData() {  char * passwordRealm;  nsAutoString buffer;  PRBool badInput = PR_FALSE;#ifdef APPLE_KEYCHAIN  if (KeychainManagerAvailable()) {    SI_RemoveAllSignonData();    return si_LoadSignonDataFromKeychain();  }#endif  /* open the signon file */  nsFileSpec dirSpec;  nsresult rv = Wallet_ProfileDirectory(dirSpec);  if (NS_FAILED(rv)) {    return -1;  }  SI_InitSignonFileName();  nsInputFileStream strm(dirSpec+signonFileName);  if (!strm.is_open()) {    si_PartiallyLoaded = PR_TRUE;    return 0;  }  SI_RemoveAllSignonData();  /* read the format information */  nsAutoString format;  if (NS_FAILED(si_ReadLine(strm, format))) {    return -1;  }  if (!format.EqualsWithConversion(HEADER_VERSION)) {    /* something's wrong */    return -1;  }  /* read the reject list */  si_lock_signon_list();  while (NS_SUCCEEDED(si_ReadLine(strm, buffer))) {    /* a blank line is perfectly valid here -- corresponds to a local file */    if (!buffer.IsEmpty() && buffer.CharAt(0) == '.') {      break; /* end of reject list */    }    si_StripLF(buffer);    passwordRealm = buffer.ToNewCString();    si_PutReject(passwordRealm, buffer, PR_FALSE); /* middle parameter is obsolete */    Recycle (passwordRealm);  }  /* read the URL line */  while (NS_SUCCEEDED(si_ReadLine(strm, buffer))) {    si_StripLF(buffer);    /* a blank line is perfectly valid here -- corresponds to a local file */    passwordRealm = buffer.ToNewCString();    if (!passwordRealm) {      si_unlock_signon_list();      return -1;    }    /* prepare to read the name/value pairs */    badInput = PR_FALSE;    nsVoidArray signonData;    si_SignonDataStruct * data;    while(NS_SUCCEEDED(si_ReadLine(strm, buffer))) {      /* line starting with . terminates the pairs for this URL entry */      if (buffer.CharAt(0) == '.') {        break; /* end of URL entry */      }      /* line just read is the name part */      /* save the name part and determine if it is a password */      PRBool ret;      si_StripLF(buffer);      nsAutoString name;      nsAutoString value;      PRBool isPassword;      if (buffer.CharAt(0) == '*') {        isPassword = PR_TRUE;        buffer.Mid(name, 1, buffer.Length()-1);        ret = si_ReadLine(strm, buffer);      } else {        isPassword = PR_FALSE;        name = buffer;        ret = si_ReadLine(strm, buffer);      }      /* read in and save the value part */      if(NS_FAILED(ret)) {        /* error in input file so give up */        badInput = PR_TRUE;        break;      }      si_StripLF(buffer);      value = buffer;      data = new si_SignonDataStruct;      data->name = name;      data->value = value;      data->isPassword = isPassword;      signonData.AppendElement(data);    }    /* store the info for this URL into memory-resident data structure */    si_PutData(passwordRealm, &signonData, PR_FALSE);    /* free up all the allocations done for processing this URL */    Recycle(passwordRealm);    PRInt32 count = signonData.Count();    for (PRInt32 i=count-1; i>=0; i--) {      data = NS_STATIC_CAST(si_SignonDataStruct*, signonData.ElementAt(i));      delete data;    }  }  si_unlock_signon_list();  si_PartiallyLoaded = PR_TRUE;  return 0;}