mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-11 04:15:43 +00:00
fixing a memory leak, just use an nsAutoString. bug=15380, r=harishd
This commit is contained in:
parent
5af5cd1de3
commit
08a06e4376
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user