talloc_free_children in samba4 talloc?

Volker Lendecke Volker.Lendecke at SerNet.DE
Tue Apr 26 03:26:41 GMT 2005

On Tue, Apr 26, 2005 at 01:19:18PM +1000, Andrew Tridgell wrote:
> before adding this, I think it is worthwhile seeing if we can't just
> get rid of talloc_destroy_pool(). For example, in the rpc code I think
> we could do this:
> void free_pipe_context(pipes_struct *p)
> {
> 	talloc_free(p->mem_ctx);
> 	p->mem_ctx = talloc_init("pipe %s %p", p->name, p);
> 	if (p->mem_ctx == NULL) {
> 		p->fault_state = True;
> 	}
> }
> totally untested code, but I think it does what is intended, and
> should not require changing the way that the Samba3 rpc code works.

Done this, segfaults. 

        prs_init(&p->out_data.rdata, 0, p->mem_ctx, MARSHALL);

in line 366 transfers the pointer to p->mem_ctx into the output parse struct.
This is not touched anymore after that. Adding


to free_pipe_context above fixes this particular one, but browsing through
rpc_parse/* and rpc_server/* gives far too many references to p->mem_ctx to be
certain enough we don't have this problem in more than these two places.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba-technical/attachments/20050426/0fec2fc6/attachment.bin

More information about the samba-technical mailing list