Delete temparray only when allocated space