aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/Analysis/malloc.mm6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/Analysis/malloc.mm b/test/Analysis/malloc.mm
index 99d1de8022..c92c966459 100644
--- a/test/Analysis/malloc.mm
+++ b/test/Analysis/malloc.mm
@@ -272,3 +272,9 @@ void test12365078_nested(unichar *characters) {
}
}
}
+
+void test12365078_check_positive() {
+ unichar *characters = (unichar*)malloc(12);
+ NSString *string = [[NSString alloc] initWithCharactersNoCopy:characters length:12 freeWhenDone:1];
+ if (string) free(characters); // expected-warning{{Attempt to free non-owned memory}}
+}