Fix memory leaks in address sanitizer darwin tests

Summary: These leaks are detected by leak sanitizer for darwin.

Reviewers: glider, kubamracek, kcc, alekseyshl

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D31978

llvm-svn: 300080
This commit is contained in:
Francis Ricci 2017-04-12 17:31:41 +00:00
parent a4961fe8ef
commit e9438b35aa
5 changed files with 5 additions and 0 deletions

View File

@ -237,4 +237,5 @@ void TestNSURLDeallocation() {
[[NSURL alloc] initWithString:@"Saved Application State"
relativeToURL:base];
[u release];
[base release];
}

View File

@ -47,5 +47,6 @@ int main() {
memset(mem[i], 'a', 8 * (i % kNumIter));
free(mem[i]);
}
malloc_destroy_zone(zone);
return 0;
}

View File

@ -54,4 +54,5 @@ int main() {
fprintf(stderr, "okthxbai!\n");
// CHECK-SCRIBBLE: okthxbai!
// CHECK-NOSCRIBBLE: okthxbai!
free(my_class_isa);
}

View File

@ -27,6 +27,7 @@ int main() {
kCFStringEncodingUTF8, FALSE); // BOOM
fprintf(stderr, "Ignored.\n");
free(a);
CFRelease(str);
}
// CHECK-CRASH: AddressSanitizer: heap-buffer-overflow

View File

@ -18,6 +18,7 @@ int main() {
kCFStringEncodingUTF8, FALSE); // BOOM
fprintf(stderr, "Ignored.\n");
free(a);
CFRelease(str);
}
// CHECK-CRASH: AddressSanitizer: heap-buffer-overflow