Always initialize pointers to NULL and always set free pointers to NULL
Tuxdev is right.
But the first, best thing you can do is:
1. Look at your code.
a) Find everyplace you declare a pointer, and initialize it to NULL at the exact point you declare it.
b) Find everyplace you free the pointer, and set it to NULL the moment after you free it.
<= This won't only help you find this particular problem...
it's also a great habit to get into
2. See if there's any place where you might inadvertantly call "free" on a variable that's already free.
Good luck .. PSM