зеркало из https://github.com/mozilla/gecko-dev.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:
Родитель
fe85f89a4d
Коммит
189a0004b8
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче