Don't iterate through the memlist twice when calling xfree().