[PATCH] Add stackframes to public libsmbclient functions

Derrell Lipman derrell.lipman at unwireduniverse.com
Mon Nov 19 15:31:16 GMT 2007


On Nov 19, 2007 10:19 AM, Gerald (Jerry) Carter <jerry at samba.org> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Derrell Lipman wrote:
>
> > The patch you provided is, I think, overly burdensome on libsmbclient
> > for not enough gain.  Let's get rid of the memory leaks where they
> > occur rather than trying to kludge it at higher layers.
>
> Derrell,
>
> I think the problem is more the fact that there are multiple exits
> from a function.  But that is your call.

I don't have a strong opinion about that one way or the other.  If the
exits are simple 'return some value' I have no problem with it.  If
every return has to do a bunch of clean-up, I prefer a single exit
point.

In this case, I'm not the original author of the code, so unless I've
had reason to change it, I've just maintained the original
organization of the code.  Even with a single entry and exit point,
though, I'd still have a hard time justifying "magic" inputs to the
lower-layer functions.  Without some strong reason to the contrary, I
prefer the black-box concept with inputs and outputs well defined by
parameters and return value.

Derrell


More information about the samba-technical mailing list