From 5cd59294c7f50f2c3cf537686ec142c44bcb7ce2 Mon Sep 17 00:00:00 2001 From: Richard Uhler Date: Wed, 1 Feb 2017 12:54:23 +0000 Subject: [PATCH] Fix memory leak in oat file assistant test. Test: oat_file_assistant_test Bug: 34339100 Change-Id: I147cb84a8448ce6b8bec3e6e21603eb1dd45e409 --- runtime/oat_file_assistant_test.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime/oat_file_assistant_test.cc b/runtime/oat_file_assistant_test.cc index 102285a4d..f777340cf 100644 --- a/runtime/oat_file_assistant_test.cc +++ b/runtime/oat_file_assistant_test.cc @@ -154,8 +154,8 @@ TEST_F(OatFileAssistantTest, EmptyVdexOdex) { std::string vdex_location = GetOdexDir() + "/EmptyVdexOdex.vdex"; Copy(GetDexSrc1(), dex_location); - OS::CreateEmptyFile(vdex_location.c_str()); - OS::CreateEmptyFile(odex_location.c_str()); + ScratchFile vdex_file(vdex_location.c_str()); + ScratchFile odex_file(odex_location.c_str()); OatFileAssistant oat_file_assistant(dex_location.c_str(), kRuntimeISA, false); EXPECT_EQ(OatFileAssistant::kDex2OatFromScratch, -- 2.11.0