Compile warnings in libsmbclient.c

Derrell Lipman derrell at samba.org
Tue Aug 14 13:31:01 GMT 2007


On 8/14/07, Volker Lendecke <Volker.Lendecke at sernet.de> wrote:
>
> Hi, Derrell!
>
>                 prs_mem_free(old->dacl->aces);
>                 prs_mem_free(&old->dacl);
>
> it looks indeed wrong. The aces and the dacl is not a
> prs_struct. Doesn't this segfault?
>

Not only doesn't it segfault, but those are being allocated, from what I
determined by tracing through the code, with prs_alloc_mem().  This fixes a
segfault.  the code is very difficult to follow, and the problem I was
fixing was a segfault due to these being freed with SAFE_FREE but not
allocated with malloc().  I believe they used to be allocated by malloc()
but that that changed with the changeover to using talloc() for most
allocations.  I'm not sure.

I'll look at it again and ensure that the proper routine is being called to
free the memory.

Derrell


More information about the samba-technical mailing list