messaging4: Add some NULL checks
authorVolker Lendecke <vl@samba.org>
Thu, 27 Mar 2014 10:08:55 +0000 (10:08 +0000)
committerJeremy Allison <jra@samba.org>
Mon, 31 Mar 2014 20:52:14 +0000 (22:52 +0200)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source4/lib/messaging/messaging.c

index b1b0003e7bd8276402cdd17a59ce825f487c1ff7..42e59a9c3bd9708c33a7090cc2699e6252d8a948 100644 (file)
@@ -601,6 +601,9 @@ struct imessaging_context *imessaging_init(TALLOC_CTX *mem_ctx,
        }
 
        msg->base_path     = lpcfg_imessaging_path(msg, lp_ctx);
+       if (msg->base_path == NULL) {
+               goto fail;
+       }
 
        ok = directory_create_or_exist_strict(msg->base_path, geteuid(), 0700);
        if (!ok) {
@@ -608,9 +611,21 @@ struct imessaging_context *imessaging_init(TALLOC_CTX *mem_ctx,
        }
 
        msg->path          = imessaging_path(msg, server_id);
+       if (msg->path == NULL) {
+               goto fail;
+       }
+
        msg->server_id     = server_id;
        msg->idr           = idr_init(msg);
+       if (msg->idr == NULL) {
+               goto fail;
+       }
+
        msg->dispatch_tree = idr_init(msg);
+       if (msg->dispatch_tree == NULL) {
+               goto fail;
+       }
+
        msg->start_time    = timeval_current();
 
        status = socket_create("unix", SOCKET_TYPE_DGRAM, &msg->sock, 0);