summaryrefslogtreecommitdiffstats
path: root/clang/unittests/libclang
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2014-04-24 19:04:10 +0000
committerNico Weber <nicolasweber@gmx.de>2014-04-24 19:04:10 +0000
commit655af097a1ed930fe96d80aaa304f60012c0ef8f (patch)
treebec67b7cbc1cccdf02840eba5e5f24cfc8a76dd8 /clang/unittests/libclang
parenta4b7cfd64f9ef026ed6a3f9271897df6bce45b7a (diff)
downloadbcm5719-llvm-655af097a1ed930fe96d80aaa304f60012c0ef8f.tar.gz
bcm5719-llvm-655af097a1ed930fe96d80aaa304f60012c0ef8f.zip
Fix a tiny test-only leak, found by LSan.
llvm-svn: 207137
Diffstat (limited to 'clang/unittests/libclang')
-rw-r--r--clang/unittests/libclang/LibclangTest.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/clang/unittests/libclang/LibclangTest.cpp b/clang/unittests/libclang/LibclangTest.cpp
index e6b32b001db..addffe5036f 100644
--- a/clang/unittests/libclang/LibclangTest.cpp
+++ b/clang/unittests/libclang/LibclangTest.cpp
@@ -49,14 +49,14 @@ struct TestVFO {
}
~TestVFO() {
- if (!Contents)
- return;
- char *BufPtr;
- unsigned BufSize;
- clang_VirtualFileOverlay_writeToBuffer(VFO, 0, &BufPtr, &BufSize);
- std::string BufStr(BufPtr, BufSize);
- EXPECT_STREQ(Contents, BufStr.c_str());
- free(BufPtr);
+ if (Contents) {
+ char *BufPtr;
+ unsigned BufSize;
+ clang_VirtualFileOverlay_writeToBuffer(VFO, 0, &BufPtr, &BufSize);
+ std::string BufStr(BufPtr, BufSize);
+ EXPECT_STREQ(Contents, BufStr.c_str());
+ free(BufPtr);
+ }
clang_VirtualFileOverlay_dispose(VFO);
}
};
OpenPOWER on IntegriCloud