Added sprint_mem function from 2.0
Trying to free things that aren't malloced.