r20944: if a call has been destroyed before a reply comes in then discard the
authorAndrew Tridgell <tridge@samba.org>
Mon, 22 Jan 2007 04:04:36 +0000 (04:04 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 19:43:57 +0000 (14:43 -0500)
reply

source/cluster/ctdb/common/ctdb_call.c

index 7883be8a0a75033a9e786ef5913a337a5c247162..648b2b0bc9a624768def68de53930c26221986b9 100644 (file)
@@ -390,6 +390,7 @@ void ctdb_reply_call(struct ctdb_context *ctdb, struct ctdb_req_header *hdr)
        TDB_DATA reply_data;
 
        state = idr_find(ctdb->idr, hdr->reqid);
+       if (state == NULL) return;
 
        reply_data.dptr = c->data;
        reply_data.dsize = c->datalen;
@@ -415,6 +416,7 @@ void ctdb_reply_dmaster(struct ctdb_context *ctdb, struct ctdb_req_header *hdr)
        TDB_DATA data;
 
        state = idr_find(ctdb->idr, hdr->reqid);
+       if (state == NULL) return;
 
        data.dptr = c->data;
        data.dsize = c->datalen;
@@ -450,6 +452,7 @@ void ctdb_reply_error(struct ctdb_context *ctdb, struct ctdb_req_header *hdr)
        struct ctdb_call_state *state;
 
        state = idr_find(ctdb->idr, hdr->reqid);
+       if (state == NULL) return;
 
        talloc_steal(state, c);
 
@@ -471,6 +474,7 @@ void ctdb_reply_redirect(struct ctdb_context *ctdb, struct ctdb_req_header *hdr)
        struct ctdb_call_state *state;
 
        state = idr_find(ctdb->idr, hdr->reqid);
+       if (state == NULL) return;
 
        talloc_steal(state, c);