check the return of asprintf