Skip to content

Commit ceb1ac9

Browse files
committed
[test] Free triple in PassBuilderBindingsTest
1 parent 6e1c1da commit ceb1ac9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

llvm/unittests/Passes/PassBuilderBindingsTest.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ using namespace llvm;
1616
class PassBuilderCTest : public testing::Test {
1717
void SetUp() override {
1818
LLVMInitializeNativeTarget();
19-
const char *Triple = LLVMGetDefaultTargetTriple();
19+
char *Triple = LLVMGetDefaultTargetTriple();
2020
char *Err;
2121
LLVMTargetRef Target;
2222
if (LLVMGetTargetFromTriple(Triple, &Target, &Err)) {
@@ -25,6 +25,7 @@ class PassBuilderCTest : public testing::Test {
2525
TM = LLVMCreateTargetMachine(Target, Triple, "generic", "",
2626
LLVMCodeGenLevelDefault, LLVMRelocDefault,
2727
LLVMCodeModelDefault);
28+
LLVMDisposeMessage(Triple);
2829
Context = LLVMContextCreate();
2930
Module = LLVMModuleCreateWithNameInContext("test", Context);
3031
}

0 commit comments

Comments
 (0)