add delayed double free tests

This commit is contained in:
Daniel Micay 2018-08-24 05:53:17 -04:00
parent aaa4eeca4d
commit 35c9e6f16d
3 changed files with 36 additions and 0 deletions

View File

@ -1,6 +1,8 @@
EXECUTABLES := \
double_free_large \
double_free_large_delayed \
double_free_small \
double_free_small_delayed \
unaligned_free_large \
unaligned_free_small \
read_after_free_large \

View File

@ -0,0 +1,17 @@
#include <stdlib.h>
__attribute__((optimize(0)))
int main(void) {
void *p = malloc(128 * 1024);
if (!p) {
return 1;
}
void *q = malloc(128 * 1024);
if (!q) {
return 1;
}
free(p);
free(q);
free(p);
return 0;
}

View File

@ -0,0 +1,17 @@
#include <stdlib.h>
__attribute__((optimize(0)))
int main(void) {
void *p = malloc(16);
if (!p) {
return 1;
}
void *q = malloc(16);
if (!q) {
return 1;
}
free(p);
free(q);
free(p);
return 0;
}