free chunks before terminate

This commit is contained in:
Steffen Vogel 2013-08-19 00:44:24 +02:00 committed by Steffen Vogel
parent 9c85f88333
commit feec2b7de8

View file

@ -68,6 +68,12 @@ int main(int argc, char** argv)
printf("malloc(%d)\tCHUNK: %d START: %p END: %p\n", size, i, test[i], test[i] + size);
}
// and release again
for (i = 0; i < chunks; i++) {
free(test[i]);
printf("free(%p)\tCHUNK: %d\n", test[i], i);
}
free(test);
return 0;
}