[ASan] Fix leaks in ASan tests found by LSan

llvm-svn: 186577
This commit is contained in:
Alexey Samsonov 2013-07-18 12:59:52 +00:00
parent e25a86b082
commit 79d79da0e1
1 changed files with 2 additions and 0 deletions

View File

@ -373,6 +373,7 @@ TEST(AddressSanitizer, ReallocFreedPointerTest) {
TEST(AddressSanitizer, ReallocInvalidPointerTest) {
void *ptr = Ident(malloc(42));
EXPECT_DEATH(ptr = realloc((int*)ptr + 1, 77), "attempting free.*not malloc");
free(ptr);
}
TEST(AddressSanitizer, ZeroSizeMallocTest) {
@ -411,6 +412,7 @@ TEST(AddressSanitizer, MallocUsableSizeTest) {
kMallocUsableSizeErrorMsg);
free(array);
EXPECT_DEATH(malloc_usable_size(array), kMallocUsableSizeErrorMsg);
delete int_ptr;
}
#endif