Removed unneeded calls to free