fixing a memory leak, just use an nsAutoString. bug=15380, r=harishd

This commit is contained in:
beard%netscape.com 1999-10-13 23:59:27 +00:00
parent 5af5cd1de3
commit 08a06e4376
2 changed files with 4 additions and 4 deletions

View File

@ -551,13 +551,13 @@ nsresult nsExpatTokenizer::LoadStream(nsIInputStream* in,
PRUint32 aCount = 1024,
bufsize = aCount*sizeof(PRUnichar);
nsIUnicharInputStream *uniIn = nsnull;
nsString *utf8 = new nsString("UTF-8");
nsAutoString utf8("UTF-8");
nsresult res = NS_NewConverterStream(&uniIn,
nsnull,
in,
aCount,
utf8);
&utf8);
if (NS_FAILED(res)) return res;
PRUint32 aReadCount = 0;

View File

@ -551,13 +551,13 @@ nsresult nsExpatTokenizer::LoadStream(nsIInputStream* in,
PRUint32 aCount = 1024,
bufsize = aCount*sizeof(PRUnichar);
nsIUnicharInputStream *uniIn = nsnull;
nsString *utf8 = new nsString("UTF-8");
nsAutoString utf8("UTF-8");
nsresult res = NS_NewConverterStream(&uniIn,
nsnull,
in,
aCount,
utf8);
&utf8);
if (NS_FAILED(res)) return res;
PRUint32 aReadCount = 0;