If the eventscript is finished but state->ctdb is NULL,
authorRonnie Sahlberg <ronniesahlberg@gmail.com>
Mon, 11 Apr 2011 19:24:43 +0000 (05:24 +1000)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Mon, 11 Apr 2011 20:36:25 +0000 (06:36 +1000)
log an error and return.

(Need to find root cause for this is soo too.)

server/eventscript.c

index 9ba3a5d9ed802bdb2fe7c1f52bd506f6b7d4f080..0967c00cca4f286ecc5565ac93261a26aa834099 100644 (file)
@@ -448,6 +448,11 @@ static void ctdb_event_script_handler(struct event_context *ev, struct fd_event
        struct ctdb_context *ctdb = state->ctdb;
        int r, status;
 
+       if (ctdb == NULL) {
+               DEBUG(DEBUG_ERR,("Eventscript finished but ctdb is NULL\n"));
+               return;
+       }
+
        r = read(state->fd[0], &current->status, sizeof(current->status));
        if (r < 0) {
                current->status = -errno;