1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00

lib: Fix CID 1362566 Dereference null return value

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
This commit is contained in:
Volker Lendecke 2016-06-07 09:58:24 +02:00
parent 6d26d7253e
commit 6279773fed

View File

@ -393,6 +393,7 @@ struct server_id messaging_server_id(const struct messaging_context *msg_ctx)
NTSTATUS messaging_reinit(struct messaging_context *msg_ctx) NTSTATUS messaging_reinit(struct messaging_context *msg_ctx)
{ {
int ret; int ret;
char *lck_path;
TALLOC_FREE(msg_ctx->msg_dgm_ref); 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 .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_dgm_ref = messaging_dgm_ref(
msg_ctx, msg_ctx->event_ctx, &msg_ctx->id.unique_id, 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); messaging_recv_cb, msg_ctx, &ret);
if (msg_ctx->msg_dgm_ref == NULL) { if (msg_ctx->msg_dgm_ref == NULL) {