diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2017-04-16 16:02:53 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2017-04-16 16:02:53 +0000 |
commit | ab0bf875a5f328a6710f4e48258979ae1bc8da1c (patch) | |
tree | 66903cf9f73151825893dcc216b04c0930317a10 /test/scudo/mismatch.cpp | |
parent | abacad30a54c59ad437ccf54ec5236a8dd7f3ba9 (diff) |
Notes
Diffstat (limited to 'test/scudo/mismatch.cpp')
-rw-r--r-- | test/scudo/mismatch.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/test/scudo/mismatch.cpp b/test/scudo/mismatch.cpp index 54cdafc86ee67..15dce83ce18aa 100644 --- a/test/scudo/mismatch.cpp +++ b/test/scudo/mismatch.cpp @@ -10,29 +10,26 @@ // caught when the related option is set. #include <assert.h> +#include <malloc.h> #include <stdlib.h> #include <string.h> -#include <malloc.h> int main(int argc, char **argv) { assert(argc == 2); if (!strcmp(argv[1], "mallocdel")) { int *p = (int *)malloc(16); - if (!p) - return 1; + assert(p); delete p; } if (!strcmp(argv[1], "newfree")) { int *p = new int; - if (!p) - return 1; + assert(p); free((void *)p); } if (!strcmp(argv[1], "memaligndel")) { int *p = (int *)memalign(16, 16); - if (!p) - return 1; + assert(p); delete p; } return 0; |