Bug 5585 - Memory leak in smbc_opendir()/smbc_closedir()
Memory leak in smbc_opendir()/smbc_closedir()
Status: RESOLVED FIXED
Product: Samba 3.0
Classification: Unclassified
Component: libsmbclient
3.0.30
Other Linux
: P3 normal
: none
Assigned To: Derrell Lipman
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-07-04 03:31 UTC by Mikhail Kshevetskiy
Modified: 2008-07-16 08:58 UTC (History)
0 users

See Also:


Attachments
test source and results (6.28 KB, application/octet-stream)
2008-07-04 03:32 UTC, Mikhail Kshevetskiy
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mikhail Kshevetskiy 2008-07-04 03:31:23 UTC
doing 
  for(i=0;i<count;i++){
    smbc_opendir();
    smbc_readdir();
    smbc_closedir();
  }
and compare valgrind results for different "count" value i found
  1) read samba directory:                 OK
  2) read contents of samba share:         OK
  3) read list of shares:                  MEMORY LEAK
  4) read list of computer in samba group: MEMORY LEAK
  5) read list of samba groups:            MEMORY LEAK

see the test souce/results in attachment. Edit and execute "x.sh" to repeat the test in your environment.
Comment 1 Mikhail Kshevetskiy 2008-07-04 03:32:30 UTC
Created attachment 3388 [details]
test source and results
Comment 2 Derrell Lipman 2008-07-16 08:58:50 UTC
Fixed with commit 88c9cf2fdc8f3d704f7f27c25ef6dc6940d451d3 for 3.2, and with commit 7a65053bc8579b4f56045fb2c658a91a4af0dfea for 3.3, with patch provided by Andreas Schneider.