Minor fix to prevent memory leaks on sequential calls of free_all.