Fix usage of free() instead of delete().