Bug 762555 (GLUSTER-823) - Fix memleak in nfs mount
Summary: Fix memleak in nfs mount
Keywords:
Status: CLOSED NOTABUG
Alias: GLUSTER-823
Product: GlusterFS
Classification: Community
Component: nfs
Version: mainline
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Shehjar Tikoo
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-04-15 02:03 UTC by Harshavardhana
Modified: 2015-12-01 16:45 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:
Regression: RTNR
Mount Type: nfs
Documentation: ---
CRM:
Verified Versions:
Embargoed:


Attachments (Terms of Use)

Description Shehjar Tikoo 2010-04-15 01:11:07 UTC
That function is called as a result of showmount -e <nfsserver>.

For the record:

addrstr contains a strdup'ed address that is assigned to elist->ex_groups->gr_name. On any failure inside this function, xdr_free_exports_list is called, which goes through the elist to free up the memory assigned to elist->ex_groups->gr_name.


Harsha, can you please send me the valgrind output file?

Comment 1 Harshavardhana 2010-04-15 01:44:28 UTC
> elist->ex_groups->gr_name. On any failure inside this function,
> xdr_free_exports_list is called, which goes through the elist to free up the
> memory assigned to elist->ex_groups->gr_name.
> 
> 
> Harsha, can you please send me the valgrind output file?

Valgrind "virtual" machine was deleted due to some space constraints. 

[harsha@sysrq src]$ cppcheck --enable=exceptNew,exceptRealloc,possibleError,unusedFunctions mount3.c 
Checking mount3.c...
[mount3.c:755]: (error) Memory leak: addrstr
Checking usage of global functions..
[harsha@sysrq src]$

Comment 2 Harshavardhana 2010-04-15 02:03:55 UTC
Found a memleak with valgrind and cppcheck that addrstr which was strduped never went free. Looks like every export list build had a leak. Not sure how many times such things are called.


Note You need to log in before you can comment on or make changes to this bug.