зеркало из https://github.com/mozilla/pjs.git
bug 275116 use the safe version of ObjectAt as required by the documentation
patch by Andreas Lange <mozilla@lange.cx> r=darin sr=biesi
This commit is contained in:
Родитель
0e646d9b81
Коммит
e6f4350ea9
|
@ -70,11 +70,11 @@ nsArray::QueryElementAt(PRUint32 aIndex,
|
|||
const nsIID& aIID,
|
||||
void ** aResult)
|
||||
{
|
||||
nsISupports * obj = mArray.ObjectAt(aIndex);
|
||||
if (!obj) return NS_ERROR_UNEXPECTED;
|
||||
nsISupports * obj = mArray.SafeObjectAt(aIndex);
|
||||
if (!obj) return NS_ERROR_ILLEGAL_VALUE;
|
||||
|
||||
// no need to worry about a leak here, because ObjectAt() doesn't
|
||||
// addref its result
|
||||
// no need to worry about a leak here, because SafeObjectAt()
|
||||
// doesn't addref its result
|
||||
return obj->QueryInterface(aIID, aResult);
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче