strm.close(); return;
delete itemList; delete aItem1; break;
wallet_ReadFromFile    (char* filename, nsVoidArray*& list, PRBool obscure, PRBool localFile, PlacementType placement = DUP_AFTER) {  /* open input stream */  nsFileSpec dirSpec;  nsresult rv;  if (localFile) {    rv = Wallet_ProfileDirectory(dirSpec);  } else {    rv = Wallet_ResourceDirectory(dirSpec);  }  if (NS_FAILED(rv)) {    return;  }  nsInputFileStream strm(dirSpec + filename);  if (!strm.is_open()) {    /* file doesn't exist -- that's not an error */    return;  }  Wallet_RestartKey();  for (;;) {    nsAutoString * aItem1;    if (NS_FAILED(wallet_GetLine(strm, aItem1, obscure))) {      /* end of file reached */      strm.close();      return;    }    nsAutoString * aItem2;    if (NS_FAILED(wallet_GetLine(strm, aItem2, obscure))) {      /* unexpected end of file reached */      delete aItem1;      strm.close();      return;    }    nsAutoString * aItem3;    if (NS_FAILED(wallet_GetLine(strm, aItem3, obscure))) {      /* end of file reached */      nsVoidArray* dummy = NULL;      wallet_WriteToList(*aItem1, *aItem2, dummy, list, placement);      strm.close();      return;    }    if (aItem3->Length()==0) {      /* just a pair of values, no need for a sublist */      nsVoidArray* dummy = NULL;      wallet_WriteToList(*aItem1, *aItem2, dummy, list, placement);    } else {      /* need to create a sublist and put item2 and item3 onto it */      nsVoidArray * itemList = new nsVoidArray();      wallet_Sublist * sublist;      sublist = PR_NEW(wallet_Sublist);      sublist->item = new nsAutoString (*aItem2);      itemList->AppendElement(sublist);      delete aItem2;      sublist = PR_NEW(wallet_Sublist);      sublist->item = new nsAutoString (*aItem3);      itemList->AppendElement(sublist);      delete aItem3;      /* add any following items to sublist up to next blank line */      nsAutoString * dummy2 = new nsAutoString("");      if (!dummy2) {        strm.close();        return;      }      for (;;) {        /* get next item for sublist */        if (NS_FAILED(wallet_GetLine(strm, aItem3, obscure))) {          /* end of file reached */          wallet_WriteToList(*aItem1, *dummy2, itemList, list, placement);          strm.close();          return;        }        if (aItem3->Length()==0) {          /* blank line reached indicating end of sublist */          wallet_WriteToList(*aItem1, *dummy2, itemList, list, placement);          break;        }        /* add item to sublist */        sublist = PR_NEW(wallet_Sublist);        sublist->item = new nsAutoString (*aItem3);        itemList->AppendElement(sublist);        delete aItem3;      }    }  }}