Bug 242183 CreateNewStreamConv and NS_NewStreamConv are silly/leaky/...

r=darin sr=darin
This commit is contained in:
timeless%mozdev.org 2004-05-04 07:43:02 +00:00
parent a4d031090f
commit 8de46ebe80
2 changed files with 5 additions and 4 deletions

View File

@ -86,9 +86,6 @@ CreateNewStreamConv(nsISupports* aOuter, REFNSIID aIID, void **aResult)
return rv;
}
rv = inst->QueryInterface(aIID, aResult);
if (NS_FAILED(rv)) {
*aResult = nsnull;
}
NS_RELEASE(inst); /* get rid of extra refcnt */
return rv;
}

View File

@ -696,5 +696,9 @@ NS_NewStreamConv(nsStreamConverterService** aStreamConv)
if (!*aStreamConv) return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(*aStreamConv);
return (*aStreamConv)->Init();
nsresult rv = (*aStreamConv)->Init();
if (NS_FAILED(rv))
NS_RELEASE(*aStreamConv);
return rv;
}