Bug 762555 (GLUSTER-823)

Summary: Fix memleak in nfs mount
Product: [Community] GlusterFS Reporter: Harshavardhana <fharshav>
Component: nfsAssignee: Shehjar Tikoo <shehjart>
Status: CLOSED NOTABUG QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: mainlineCC: amarts, cww, gluster-bugs
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: RTNR Mount Type: nfs
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description Shehjar Tikoo 2010-04-14 21:11:07 EDT
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-14 21:44:28 EDT
> 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-14 22:03:55 EDT
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.