Fix memory error in asc format IO

Found with cppcheck 1.64

Change-Id: I72e80cd2b11559be47d449d0a8d444857843979b