finish 5.9

This commit is contained in:
firmianay
2018-05-14 14:12:33 +08:00
parent 02e30ea8be
commit 4da0a7a15f
9 changed files with 283 additions and 136 deletions

View File

@ -0,0 +1,12 @@
#include <stdlib.h>
#include <stdio.h>
void main() {
char *p;
p = malloc(1000);
fprintf(stderr, "About to free\n");
free(p);
fprintf(stderr, "About to free a second time\n");
free(p);
fprintf(stderr, "Finish\n");
}

View File

@ -0,0 +1,21 @@
#include <stdlib.h>
#include <stdio.h>
#include <mcheck.h>
void main() {
char *p;
mtrace();
calloc(16, 16);
fprintf(stderr, "calloc some chunks that will not be freed\n");
p = malloc(1000);
fprintf(stderr, "About to free\n");
free(p);
fprintf(stderr, "About to free a second time\n");
free(p);
fprintf(stderr, "Finish\n");
muntrace();
}