fix a bug in the plain allocation freeing method