If you allocate memory dynamically from the heap, then don't return it before the program exits, it's no longer available for other programs.
Here is the example Code: int main() { char *buffer1; char *buffer2; buffer1 = (char *)malloc(5*sizeof(char)); buffer2 = (char *)malloc(5*sizeof(char)); buffer1 = buffer2; // This will lead Memory leak . . . . }