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
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) {
/* Free the handles database. */
close_policy_by_pipe(p);
- free_pipe_rpc_context_internal(p->contexts);
-
DLIST_REMOVE(InternalPipes, p);
return 0;
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;
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;