fix asprintf error check