Fix a tiny test-only leak, found by LSan.

llvm-svn: 207137
This commit is contained in:
Nico Weber 2014-04-24 19:04:10 +00:00
parent a4b7cfd64f
commit 655af097a1
1 changed files with 8 additions and 8 deletions

View File

@ -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);
}
};