daemon: Avoid double-free during monitor cancellation
authorAmitay Isaacs <amitay@gmail.com>
Fri, 10 Jul 2015 04:02:29 +0000 (14:02 +1000)
committerAmitay Isaacs <amitay@gmail.com>
Thu, 16 Jul 2015 04:36:41 +0000 (14:36 +1000)
The eventscript state should never be freed externally, so it should
never be allocated off a temporary context.  It will either be freed
by the handler or in the cancellation code.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Pair-programmed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Martin Schwenke <martin@meltin.net>
(Imported from commit f951ff13838e796cd6661d800daf460247cac60b)

server/eventscript.c

index 84dcf68f4660e117a6be742c5becf3d879a434c1..34e7d41343b698e7518e96aea422482c4c46c32f 100644 (file)
@@ -972,7 +972,7 @@ int32_t ctdb_run_eventscripts(struct ctdb_context *ctdb,
        DEBUG(DEBUG_NOTICE,("Running eventscripts with arguments %s\n", indata.dptr));
 
        ret = ctdb_event_script_callback(ctdb, 
-                        state, run_eventscripts_callback, state,
+                        ctdb, run_eventscripts_callback, state,
                         call, "%s", options);
 
        if (ret != 0) {