]> git.samba.org - gd/samba-autobuild/.git/commitdiff
s3/lib/dbwrap: check if global_messaging_context() succeeded
authorRalph Boehme <slow@samba.org>
Sat, 7 Aug 2021 10:51:38 +0000 (10:51 +0000)
committerRalph Boehme <slow@samba.org>
Tue, 17 Aug 2021 10:31:29 +0000 (10:31 +0000)
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 <slow@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
source3/lib/dbwrap/dbwrap_open.c

index 1d8c40af75e65ce78b39949893e4bcf45ed14e27..52c8a94aeff0fbb26371011208c748b70e06c3f1 100644 (file)
@@ -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) {