diff --git a/toolkit/components/places/src/nsNavHistoryResult.cpp b/toolkit/components/places/src/nsNavHistoryResult.cpp index 7030efd5a2d..f1b50af409c 100644 --- a/toolkit/components/places/src/nsNavHistoryResult.cpp +++ b/toolkit/components/places/src/nsNavHistoryResult.cpp @@ -1336,7 +1336,10 @@ nsNavHistoryQueryResultNode::VerifyQueriesParsed() getter_AddRefs(options)); NS_ENSURE_SUCCESS(rv, rv); mOptions = do_QueryInterface(options, &rv); // need concrete pointer - NS_ENSURE_SUCCESS(rv, rv); + if (NS_FAILED(rv)) { + nsMemory::Free(queries); + return rv; + } // Copy the individual queries into our array. At the same time, note if // we have any bookmark components so we know whether to pay attention to