mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 997686 - SocketTransportService infaliible malloc cleanup r=sworkman
This commit is contained in:
parent
482505a98c
commit
33a8c7d829
@ -619,18 +619,13 @@ nsSocketTransportService::CreateTransport(const char **types,
|
||||
NS_ENSURE_TRUE(mInitialized, NS_ERROR_NOT_INITIALIZED);
|
||||
NS_ENSURE_TRUE(port >= 0 && port <= 0xFFFF, NS_ERROR_ILLEGAL_VALUE);
|
||||
|
||||
nsSocketTransport *trans = new nsSocketTransport();
|
||||
if (!trans)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
NS_ADDREF(trans);
|
||||
|
||||
nsRefPtr<nsSocketTransport> trans = new nsSocketTransport();
|
||||
nsresult rv = trans->Init(types, typeCount, host, port, proxyInfo);
|
||||
if (NS_FAILED(rv)) {
|
||||
NS_RELEASE(trans);
|
||||
return rv;
|
||||
}
|
||||
|
||||
*result = trans;
|
||||
trans.forget(result);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -648,8 +643,6 @@ nsSocketTransportService::CreateUnixDomainTransport(nsIFile *aPath,
|
||||
return rv;
|
||||
|
||||
nsRefPtr<nsSocketTransport> trans = new nsSocketTransport();
|
||||
if (!trans)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
rv = trans->InitWithFilename(path.get());
|
||||
if (NS_FAILED(rv))
|
||||
|
Loading…
Reference in New Issue
Block a user