Fix memory leak related to int8. (#14697)