diff options
author | Stefan Metzmacher <metze@samba.org> | 2007-05-07 15:19:53 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:52:09 -0500 |
commit | 68b531e81784d218b598e4ec403443bbc039ca77 (patch) | |
tree | e685ecad58c316d598db1cace2e6108845cd47a5 /source4/lib | |
parent | 56ab0cd77c7abf777ebe5666a47fa3affea7d2ae (diff) | |
download | samba-68b531e81784d218b598e4ec403443bbc039ca77.tar.gz samba-68b531e81784d218b598e4ec403443bbc039ca77.tar.bz2 samba-68b531e81784d218b598e4ec403443bbc039ca77.zip |
r22748: fix memleaks by passing an mem_ctx to
irpc_servers_byname()
metze
(This used to be commit b54584dfabee77ec7743cab431bda9765057a295)
Diffstat (limited to 'source4/lib')
-rw-r--r-- | source4/lib/messaging/irpc.h | 2 | ||||
-rw-r--r-- | source4/lib/messaging/messaging.c | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/source4/lib/messaging/irpc.h b/source4/lib/messaging/irpc.h index 6873f014a6..0ea1d5d69f 100644 --- a/source4/lib/messaging/irpc.h +++ b/source4/lib/messaging/irpc.h @@ -117,7 +117,7 @@ NTSTATUS irpc_call(struct messaging_context *msg_ctx, int callnum, void *r, TALLOC_CTX *ctx); NTSTATUS irpc_add_name(struct messaging_context *msg_ctx, const char *name); -struct server_id *irpc_servers_byname(struct messaging_context *msg_ctx, const char *name); +struct server_id *irpc_servers_byname(struct messaging_context *msg_ctx, TALLOC_CTX *mem_ctx, const char *name); void irpc_remove_name(struct messaging_context *msg_ctx, const char *name); NTSTATUS irpc_send_reply(struct irpc_message *m, NTSTATUS status); diff --git a/source4/lib/messaging/messaging.c b/source4/lib/messaging/messaging.c index 705fdcc465..9b4f4b49c4 100644 --- a/source4/lib/messaging/messaging.c +++ b/source4/lib/messaging/messaging.c @@ -961,7 +961,8 @@ NTSTATUS irpc_add_name(struct messaging_context *msg_ctx, const char *name) /* return a list of server ids for a server name */ -struct server_id *irpc_servers_byname(struct messaging_context *msg_ctx, +struct server_id *irpc_servers_byname(struct messaging_context *msg_ctx, + TALLOC_CTX *mem_ctx, const char *name) { struct tdb_wrap *t; @@ -985,7 +986,7 @@ struct server_id *irpc_servers_byname(struct messaging_context *msg_ctx, return NULL; } count = rec.dsize / sizeof(struct server_id); - ret = talloc_array(msg_ctx, struct server_id, count+1); + ret = talloc_array(mem_ctx, struct server_id, count+1); if (ret == NULL) { tdb_unlock_bystring(t->tdb, name); talloc_free(t); |