diff options
author | Nico Weber <nicolasweber@gmx.de> | 2014-04-24 19:04:10 +0000 |
---|---|---|
committer | Nico Weber <nicolasweber@gmx.de> | 2014-04-24 19:04:10 +0000 |
commit | 655af097a1ed930fe96d80aaa304f60012c0ef8f (patch) | |
tree | bec67b7cbc1cccdf02840eba5e5f24cfc8a76dd8 /clang/unittests/libclang | |
parent | a4b7cfd64f9ef026ed6a3f9271897df6bce45b7a (diff) | |
download | bcm5719-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.cpp | 16 |
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); } }; |