FW: RPC restructuring finished (mostly).

Jeremy Allison jeremy at valinux.com
Thu Mar 1 16:19:39 GMT 2001

Luke Kenneth Casson Leighton wrote:
> > I've been catching these issues with insure, and I
> > then copy the relevent structures out of the talloc'ed
> > areas before storage. There are less of these than you
> > might think - and memory leaks are not acceptible in a
> > long lived daemon.
> ... then why not fix those few? :)

That's what I'm doing :-) :-).

> so.  important question.
> you can guarantee that in both the client-side and the server-side code,
> the user-or-consumer (being client and server respectively) is responsible
> for freeing memory, and that the marshalling/unmarshalling's use of memory
> is therefore effectively transparent?
> remember the NetApiBufferFree() function that has to be called for the
> usage of the NET* API?

The idea will be that the caller (client or server) will
hand a talloc context to the RPC code, and then copy out
of the talloced memory any structures that need to be
long lived then destroy the context (freeing everything
allocated in the call).

That way error returns get much easier, as you can just
return without needing to remember and free everything
you allocated on the way down the call chain.


Buying an operating system without source is like buying
a self-assembly Space Shuttle with no instructions.

More information about the samba-technical mailing list