From: Amitay Isaacs Date: Mon, 27 Jun 2016 08:00:49 +0000 (+1000) Subject: ctdb-daemon: Check if method is initialized before calling X-Git-Tag: tdb-1.3.10~497 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ca35d8149d987258440ed2f8746a953ad74effdf;p=thirdparty%2Fsamba.git ctdb-daemon: Check if method is initialized before calling Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke --- diff --git a/ctdb/server/ctdb_daemon.c b/ctdb/server/ctdb_daemon.c index 0f17b0f4681..d9275f8fd38 100644 --- a/ctdb/server/ctdb_daemon.c +++ b/ctdb/server/ctdb_daemon.c @@ -1821,7 +1821,7 @@ void ctdb_shutdown_sequence(struct ctdb_context *ctdb, int exit_code) ctdb_stop_monitoring(ctdb); ctdb_release_all_ips(ctdb); ctdb_event_script(ctdb, CTDB_EVENT_SHUTDOWN); - if (ctdb->methods != NULL) { + if (ctdb->methods != NULL && ctdb->methods->shutdown != NULL) { ctdb->methods->shutdown(ctdb); } diff --git a/ctdb/server/ctdb_fork.c b/ctdb/server/ctdb_fork.c index 93977d9c3be..4edbe88e154 100644 --- a/ctdb/server/ctdb_fork.c +++ b/ctdb/server/ctdb_fork.c @@ -91,7 +91,7 @@ pid_t ctdb_fork(struct ctdb_context *ctdb) close(ctdb->daemon.sd); ctdb->daemon.sd = -1; } - if (ctdb->methods != NULL) { + if (ctdb->methods != NULL && ctdb->methods->shutdown != NULL) { ctdb->methods->shutdown(ctdb); }