memory leak -- comments?

Jeremy Allison jra at samba.org
Thu Dec 15 23:45:18 GMT 2005


On Thu, Dec 15, 2005 at 06:39:01PM -0500, derrell at samba.org wrote:
> Hi Jeremy,
> 
> I received the attached report, including valgrind output.  It looks to me as
> if cli_receive_trans() allocates 'param' and 'data', and then, back in
> cli_list_new(), if one of these three conditions is true, we'll have a memory
> leak:
> 
>   if (cli_is_error_cli(cli) || !rdata || !rparam)
> 
> or
> 
>   if (ff_searchcount == 0)
> 
> or
>   if (!tdl)      /* malloc failed)
> 
> Of these, the one likely to occur is ff_searchcount == 0.  I suspect that
> was the cause of this report.  Agree?  Each of these cases should be
> SAFE_FREE()ing rdata and rparam, right?

Looks correct to me. All exits after cli_receive_trans() should
be freeing rdata and rparam.

Do you want me to fix it ?

Jeremy.


More information about the samba-technical mailing list