From da8b009ff72b801b930830a31009d1edc5418aea Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Thu, 27 Mar 2014 10:08:55 +0000 Subject: messaging4: Add some NULL checks Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- source4/lib/messaging/messaging.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'source4/lib/messaging/messaging.c') diff --git a/source4/lib/messaging/messaging.c b/source4/lib/messaging/messaging.c index b1b0003e7bd..42e59a9c3bd 100644 --- a/source4/lib/messaging/messaging.c +++ b/source4/lib/messaging/messaging.c @@ -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); -- cgit