From: Ralph Boehme Date: Sat, 7 Aug 2021 10:51:38 +0000 (+0000) Subject: s3/lib/dbwrap: check if global_messaging_context() succeeded X-Git-Tag: ldb-2.5.0~968 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fd19cae8d2f21977d8285efd3f29e2b480d241e9;p=thirdparty%2Fsamba.git s3/lib/dbwrap: check if global_messaging_context() succeeded The subsequent messaging_ctdb_connection() will fail an assert if messaging is not up and running, maybe it's a bit better to add a check if global_messaging_context() actually succeeded. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14787 Signed-off-by: Ralph Boehme Reviewed-by: Andreas Schneider --- diff --git a/source3/lib/dbwrap/dbwrap_open.c b/source3/lib/dbwrap/dbwrap_open.c index 1d8c40af75e..52c8a94aeff 100644 --- a/source3/lib/dbwrap/dbwrap_open.c +++ b/source3/lib/dbwrap/dbwrap_open.c @@ -149,6 +149,10 @@ struct db_context *db_open(TALLOC_CTX *mem_ctx, * to be initialized. */ msg_ctx = global_messaging_context(); + if (msg_ctx == NULL) { + DBG_ERR("Failed to initialize messaging\n"); + return NULL; + } conn = messaging_ctdb_connection(); if (conn == NULL) {