From 6279773fed4c31bc5fb93979756125b184070443 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 7 Jun 2016 09:58:24 +0200 Subject: [PATCH] lib: Fix CID 1362566 Dereference null return value Signed-off-by: Volker Lendecke Reviewed-by: Michael Adam --- source3/lib/messages.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/source3/lib/messages.c b/source3/lib/messages.c index ef8e83dd6e6..65e975ec788 100644 --- a/source3/lib/messages.c +++ b/source3/lib/messages.c @@ -393,6 +393,7 @@ struct server_id messaging_server_id(const struct messaging_context *msg_ctx) NTSTATUS messaging_reinit(struct messaging_context *msg_ctx) { int ret; + char *lck_path; TALLOC_FREE(msg_ctx->msg_dgm_ref); @@ -400,9 +401,14 @@ NTSTATUS messaging_reinit(struct messaging_context *msg_ctx) .pid = getpid(), .vnn = msg_ctx->id.vnn }; + lck_path = lock_path("msg.lock"); + if (lck_path == NULL) { + return NT_STATUS_NO_MEMORY; + } + msg_ctx->msg_dgm_ref = messaging_dgm_ref( msg_ctx, msg_ctx->event_ctx, &msg_ctx->id.unique_id, - private_path("msg.sock"), lock_path("msg.lock"), + private_path("msg.sock"), lck_path, messaging_recv_cb, msg_ctx, &ret); if (msg_ctx->msg_dgm_ref == NULL) {