mirror of
https://github.com/samba-team/samba.git
synced 2025-02-03 13:47:25 +03:00
s4-messaging: fixed a memory leak in messaging_path()
It is a bit convoluted to fix, as cluster_id_string() may return a const string.
This commit is contained in:
parent
196cb6b359
commit
6a36799d30
@ -119,8 +119,15 @@ static NTSTATUS irpc_uptime(struct irpc_message *msg,
|
||||
*/
|
||||
static char *messaging_path(struct messaging_context *msg, struct server_id server_id)
|
||||
{
|
||||
return talloc_asprintf(msg, "%s/msg.%s", msg->base_path,
|
||||
cluster_id_string(msg, server_id));
|
||||
TALLOC_CTX *tmp_ctx = talloc_new(msg);
|
||||
const char *id = cluster_id_string(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;
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
x
Reference in New Issue
Block a user