messaging4: Add NULL check to irpc_add_name
authorVolker Lendecke <vl@samba.org>
Thu, 17 Jul 2014 14:08:58 +0000 (14:08 +0000)
committerVolker Lendecke <vl@samba.org>
Mon, 21 Jul 2014 16:00:10 +0000 (18:00 +0200)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
source4/lib/messaging/messaging.c

index e7b1e9d6cdd99542f09fc9495daa082d706b8b2e..5def9d1f7343f0d6494ee23fe3288de1a6c614e6 100644 (file)
@@ -940,6 +940,9 @@ NTSTATUS irpc_add_name(struct imessaging_context *msg_ctx, const char *name)
        }
 
        msg_ctx->names = str_list_add(msg_ctx->names, name);
+       if (msg_ctx->names == NULL) {
+               return NT_STATUS_NO_MEMORY;
+       }
        talloc_steal(msg_ctx, msg_ctx->names);
 
        return status;