Possible memory leak password.c/pass_check_smb().
Jeremy Allison
jra at samba.org
Mon Apr 8 13:09:02 GMT 2002
On Mon, Apr 08, 2002 at 09:24:21AM -0400, Adrian Chung wrote:
> [sent to samba-general, should have probably send it here]
>
> Hi! I'm running Samba 2.2.3a with a whole bunch of Windows XP
> clients, and have been noticing that Samba has been consuming all
> available memory resources if left unchecked for about a week.
>
> After some digging, and correlating the following messages in my logs:
>
> [2002/04/07 19:42:17, 1] smbd/password.c:pass_check_smb(555)
> Couldn't find user 'nobody' in passdb.
>
> I decided to put 'nobody' in my smbpasswd file.
>
> After doing that, the leak seems to have gone away.
>
> On further inspection, looking at source/smbd/password.c close to line
> 555:
>
> [...]
> BOOL pass_check_smb...
> [..]
> /* get the account information */
> pdb_init_sam(&sampass);
> if (!pdb_getsampwnam(sampass, user)) {
> DEBUG(1,("Couldn't find user '%s' in passdb.\n", user));
> return(False);
> }
> [...]
>
> It looks like pdb_init_sam() is called which actually malloc's memory,
> but never free's it, and returns.
Good catch ! I've fixed this for 2.2.4 - thanks !
Jeremy.
More information about the samba-technical
mailing list