diff options
Diffstat (limited to 'test/scudo/double-free.cpp')
-rw-r--r-- | test/scudo/double-free.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/test/scudo/double-free.cpp b/test/scudo/double-free.cpp index 75919f0c459c..ddc520505ed1 100644 --- a/test/scudo/double-free.cpp +++ b/test/scudo/double-free.cpp @@ -16,30 +16,26 @@ int main(int argc, char **argv) assert(argc == 2); if (!strcmp(argv[1], "malloc")) { void *p = malloc(sizeof(int)); - if (!p) - return 1; + assert(p); free(p); free(p); } if (!strcmp(argv[1], "new")) { int *p = new int; - if (!p) - return 1; + assert(p); delete p; delete p; } if (!strcmp(argv[1], "newarray")) { int *p = new int[8]; - if (!p) - return 1; + assert(p); delete[] p; delete[] p; } if (!strcmp(argv[1], "memalign")) { void *p = nullptr; posix_memalign(&p, 0x100, sizeof(int)); - if (!p) - return 1; + assert(p); free(p); free(p); } |