diff --git a/unittests/Linker/LinkModulesTest.cpp b/unittests/Linker/LinkModulesTest.cpp index 2a0a7bfa847..45f1308d3bd 100644 --- a/unittests/Linker/LinkModulesTest.cpp +++ b/unittests/Linker/LinkModulesTest.cpp @@ -216,7 +216,7 @@ TEST_F(LinkModuleTest, CAPIFailure) { LLVMLinkerDestroySource, &errout); EXPECT_EQ(1, result); EXPECT_STREQ("Linking globals named 'foo': symbol multiply defined!", errout); - std::free(errout); + LLVMDisposeMessage(errout); } } // end anonymous namespace