Realloc leak

Herb Lewis herb at sgi.com
Fri Oct 12 08:49:03 GMT 2001


andreas moroder wrote:
> 
> Hello,
> 
> in HEAD there are two Realloc memory leaks (result of Realloc is assigned to
> the same variable passed to Realloc )
> 
> msdfs/msdfs.c line 398
> 
>         pdata = Realloc(pdata,reply_size);
>         if(pdata == NULL) {
>                 DEBUG(0,("malloc failed for Realloc!\n"));
>                 return -1;
>         }
>         else *ppdata = pdata;

In this case pdata is a local copy of ppdata (which doesn't
get changed unless the Realloc is successful so there is no
leak.

> 
> nsswitch/winbindd_group.c line 783
> 
>                         sam_entries = Realloc(sam_entries, new_size);
> 
>                         if (!sam_entries)
>                                 return WINBINDD_ERROR;
> 

This one looks like a potential problem.

> Bye
> 
> Andreas

-- 
======================================================================
Herb Lewis                               Silicon Graphics 
Networking Engineer                      1600 Amphitheatre Pkwy MS-510
Strategic Software Organization          Mountain View, CA  94043-1351
herb at sgi.com                             Tel: 650-933-2177
http://www.sgi.com                       Fax: 650-932-2177          
======================================================================




More information about the samba-technical mailing list