X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=libevent%2Fevrpc.c;h=4bf3d2b42540d3bd7d01844dcfe31244c9b9be98;hb=refs%2Fheads%2Fv3.1.6-alex;hp=e11892dcc07175cee690dec8bf9898b8a4014fa6;hpb=75cceac7017a24e33d65f917155ad0d8b15ef178;p=netatalk.git diff --git a/libevent/evrpc.c b/libevent/evrpc.c index e11892dc..4bf3d2b4 100644 --- a/libevent/evrpc.c +++ b/libevent/evrpc.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2000-2007 Niels Provos - * Copyright (c) 2007-2010 Niels Provos and Nick Mathewson + * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -338,8 +338,12 @@ static void evrpc_request_cb_closure(void *arg, enum EVRPC_HOOK_RESULT hook_res) { struct evrpc_req_generic *rpc_state = arg; - struct evrpc *rpc = rpc_state->rpc; - struct evhttp_request *req = rpc_state->http_req; + struct evrpc *rpc; + struct evhttp_request *req; + + EVUTIL_ASSERT(rpc_state); + rpc = rpc_state->rpc; + req = rpc_state->http_req; if (hook_res == EVRPC_TERMINATE) goto error; @@ -399,8 +403,13 @@ evrpc_request_done_closure(void *, enum EVRPC_HOOK_RESULT); void evrpc_request_done(struct evrpc_req_generic *rpc_state) { - struct evhttp_request *req = rpc_state->http_req; - struct evrpc *rpc = rpc_state->rpc; + struct evhttp_request *req; + struct evrpc *rpc; + + EVUTIL_ASSERT(rpc_state); + + req = rpc_state->http_req; + rpc = rpc_state->rpc; if (rpc->reply_complete(rpc_state->reply) == -1) { /* the reply was not completely filled in. error out */ @@ -466,7 +475,9 @@ static void evrpc_request_done_closure(void *arg, enum EVRPC_HOOK_RESULT hook_res) { struct evrpc_req_generic *rpc_state = arg; - struct evhttp_request *req = rpc_state->http_req; + struct evhttp_request *req; + EVUTIL_ASSERT(rpc_state); + req = rpc_state->http_req; if (hook_res == EVRPC_TERMINATE) goto error;