summaryrefslogtreecommitdiff
path: root/test/invalid-realloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/invalid-realloc.c')
-rw-r--r--test/invalid-realloc.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/invalid-realloc.c b/test/invalid-realloc.c
new file mode 100644
index 0000000..f60bedc
--- /dev/null
+++ b/test/invalid-realloc.c
@@ -0,0 +1,12 @@
+#define _POSIX_C_SOURCE 200809L
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#include "mapalloc.h"
+
+int main(void)
+{
+ int foo = 42;
+ int *ptr = MA_realloc(&foo, sizeof(int));
+ printf("%d\n", *ptr);
+}