1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

s3-rpc_server: Use talloc for pipe_rpc_fns

Everything uses talloc in the rpc server nowadays, remove this ancient use of
malloc. This also allows us to remove the free fucntion and let talloc handle
it properly.

Autobuild-User: Simo Sorce <idra@samba.org>
Autobuild-Date: Thu Jul 28 17:41:08 CEST 2011 on sn-devel-104
This commit is contained in:
Simo Sorce 2011-07-27 16:40:21 -04:00
parent 48a71664f2
commit e84c7a2e26
3 changed files with 7 additions and 22 deletions

View File

@ -107,20 +107,6 @@ bool check_open_pipes(void)
Close an rpc pipe.
****************************************************************************/
static void free_pipe_rpc_context_internal(struct pipe_rpc_fns *list)
{
struct pipe_rpc_fns *tmp = list;
struct pipe_rpc_fns *tmp2;
while (tmp) {
tmp2 = tmp->next;
SAFE_FREE(tmp);
tmp = tmp2;
}
return;
}
int close_internal_rpc_pipe_hnd(struct pipes_struct *p)
{
if (!p) {
@ -131,8 +117,6 @@ int close_internal_rpc_pipe_hnd(struct pipes_struct *p)
/* Free the handles database. */
close_policy_by_pipe(p);
free_pipe_rpc_context_internal(p->contexts);
DLIST_REMOVE(InternalPipes, p);
return 0;

View File

@ -80,10 +80,11 @@ struct pipes_struct *make_internal_rpc_pipe_p(TALLOC_CTX *mem_ctx,
return NULL;
}
context_fns = SMB_MALLOC_P(struct pipe_rpc_fns);
context_fns = talloc(p, struct pipe_rpc_fns);
if (context_fns == NULL) {
DEBUG(0,("malloc() failed!\n"));
return False;
DEBUG(0,("talloc() failed!\n"));
TALLOC_FREE(p);
return NULL;
}
context_fns->next = context_fns->prev = NULL;

View File

@ -356,10 +356,10 @@ static bool check_bind_req(struct pipes_struct *p,
return false;
}
context_fns = SMB_MALLOC_P(struct pipe_rpc_fns);
context_fns = talloc(p, struct pipe_rpc_fns);
if (context_fns == NULL) {
DEBUG(0,("check_bind_req: malloc() failed!\n"));
return False;
DEBUG(0,("check_bind_req: talloc() failed!\n"));
return false;
}
context_fns->next = context_fns->prev = NULL;