Bug 336110 Missing out-of-memory check at directory/xpcom/base/src/nsLDAPConnection.cpp:1002. r/sr=dmose

This commit is contained in:
bugzilla%standard8.demon.co.uk 2006-05-03 16:16:09 +00:00
parent 2353c994b0
commit ab27413ce3

View File

@ -1005,9 +1005,8 @@ nsLDAPConnection::OnLookupComplete(nsICancelable *aRequest,
// all locking etc. in nsLDAPConnection::Release().
//
mRunnable = new nsLDAPConnectionLoop();
NS_ADDREF(mRunnable);
rv = mRunnable->Init();
if (NS_FAILED(rv)) {
NS_IF_ADDREF(mRunnable);
if (!mRunnable || NS_FAILED(mRunnable->Init())) {
rv = NS_ERROR_OUT_OF_MEMORY;
} else {
// Here we keep a weak reference in the runnable object to the