check asprintf for error return