Well if I am reading this right.
dlfree (mem=0x0)
We are freeing a null pointer some where.
Hmmmmmmmmm Roger