Removed unnecessary malloc/free