I agree with the previous comment that if you want people to look at your problem seriously, more code is seriously needed.
Without code I can only mumble generalities like:
- How have you determined you have a memory leak?
- Are you using strict and warnings?