Exit smbstatus cleanly if messaging_init fails
authorVolker Lendecke <vl@samba.org>
Fri, 13 Jun 2008 10:00:24 +0000 (12:00 +0200)
committerMichael Adam <obnox@samba.org>
Wed, 13 Aug 2008 09:54:04 +0000 (11:54 +0200)
(This used to be commit 5fd51833a31b326d83ac2f76d06560920547f657)

source3/utils/status.c

index e4592dd8500f6b4e75660a7fbe081981baf027df..45de872db6cade74bd14938097ebd82d77d0ccef 100644 (file)
@@ -375,6 +375,12 @@ static int traverse_sessionid(struct db_record *db, void *state)
        msg_ctx = messaging_init(NULL, procid_self(),
                                 event_context_init(NULL));
 
+       if (msg_ctx == NULL) {
+               fprintf(stderr, "messaging_init failed\n");
+               ret = -1;
+               goto done;
+       }
+
        db_tdb2_setup_messaging(msg_ctx, true);
 
        if (!lp_load(get_dyn_CONFIGFILE(),False,False,False,True)) {