From 29ce9238c6a05abb1de5e4175c97e4fcadd5640f Mon Sep 17 00:00:00 2001 From: thestig Date: Wed, 22 Jun 2016 07:03:23 -0700 Subject: Fix memory leaks in EmbedderTest::OpenDocument(). EmbedderTest::OpenDocument() does not gracefully handle the case of being called twice in a given test case. So avoid doing that. Review-Url: https://codereview.chromium.org/2088093002 --- testing/embedder_test.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'testing') diff --git a/testing/embedder_test.cpp b/testing/embedder_test.cpp index 59190a7751..9ef1e06dca 100644 --- a/testing/embedder_test.cpp +++ b/testing/embedder_test.cpp @@ -120,6 +120,7 @@ bool EmbedderTest::OpenDocument(const std::string& filename, if (!file_contents_) return false; + EXPECT_TRUE(!loader_); loader_ = new TestLoader(file_contents_.get(), file_length_); file_access_.m_FileLen = static_cast(file_length_); file_access_.m_GetBlock = TestLoader::GetBlock; -- cgit v1.2.3