In error_response(), factor the (rsp->status == NULL) checks out of the if blocks.