One minor point to make: it isn't a memory leak if there's an accessible pointer to it.
Code:
#include <stdlib.h>
int main()
{
char *characters = NULL;
characters = (char*) malloc(1000000); /*<-- this is a memory leak*/
characters = (char*) malloc(1000000); /*<-- this is a memory leak*/
characters = (char*) malloc(1000000); /*<-- this is a memory leak*/
characters = (char*) malloc(1000000); /*<-- this is a memory leak*/
characters = (char*) malloc(1000000); /*<-- this is a memory leak*/
characters = (char*) malloc(1000000); /*<-- this is a memory leak*/
characters = (char*) malloc(1000000); /*<-- this is a memory leak*/
characters = (char*) malloc(1000000); /*<-- this is a memory leak*/
characters = (char*) malloc(1000000); /*<-- this isn't a memory leak*/
}
Kevin Barry