From d697c9fdcb9d1d08fa80fc78a299690c8114917c Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 20 Jul 2014 16:07:44 +0200 Subject: [PATCH] messaging4: Simplify imessaging_path Use server_id_str_buf Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison Autobuild-User(master): Jeremy Allison Autobuild-Date(master): Tue Jul 29 00:30:55 CEST 2014 on sn-devel-104 --- source4/lib/messaging/messaging.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/source4/lib/messaging/messaging.c b/source4/lib/messaging/messaging.c index ffa668a4458..a67a58a6e06 100644 --- a/source4/lib/messaging/messaging.c +++ b/source4/lib/messaging/messaging.c @@ -136,15 +136,10 @@ static NTSTATUS irpc_uptime(struct irpc_message *msg, */ static char *imessaging_path(struct imessaging_context *msg, struct server_id server_id) { - TALLOC_CTX *tmp_ctx = talloc_new(msg); - const char *id = server_id_str(tmp_ctx, &server_id); - char *s; - if (id == NULL) { - return NULL; - } - s = talloc_asprintf(msg, "%s/msg.%s", msg->base_path, id); - talloc_steal(s, tmp_ctx); - return s; + struct server_id_buf buf; + + return talloc_asprintf(msg, "%s/msg.%s", msg->base_path, + server_id_str_buf(server_id, &buf)); } /* -- 2.11.4.GIT