Checked for null in memory allocation per bug #9852

git-svn-id: svn://10.0.0.236/trunk@39561 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
dbragg%netscape.com 1999-07-15 23:06:52 +00:00
parent 7698b1b0b0
commit 4b7d91b21a

View File

@ -226,11 +226,15 @@ nsJAREnumerator::GetNext(nsISupports** aResult)
// pack into an nsIJARItem
nsIJARItem* jarItem = new nsJARItem(mCurr);
jarItem->AddRef();
*aResult = jarItem;
mIsCurrStale = PR_TRUE; // we just gave this one away
return NS_OK;
if(jarItem)
{
jarItem->AddRef();
*aResult = jarItem;
mIsCurrStale = PR_TRUE; // we just gave this one away
return NS_OK;
}
else
return NS_ERROR_OUT_OF_MEMORY;
}