Bug 1670334

Summary: Some memory leaks found in GlusterFS 5.3
Product: [Community] GlusterFS Reporter: Terry Cui <i_chips>
Component: glusterdAssignee: Atin Mukherjee <amukherj>
Status: CLOSED NEXTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: unspecified    
Version: 5CC: atumball, bugs, nbalacha
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: glusterfs-7.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-07-05 08:49:45 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Terry Cui 2019-01-29 10:06:59 UTC
Description of problem:
In xlators\mgmt\glusterd\src\glusterd-mountbroker.c, the function make_ghadoop_mountspec() has memory leak.

I'm afraid that it could be modified like this:

int
make_ghadoop_mountspec(gf_mount_spec_t *mspec, const char *volname, char *user,
                       char *server)
{
    char *hadoop_mnt_desc = NULL;
    int ret = 0;

    ret = gf_asprintf(&hadoop_mnt_desc, hadoop_mnt_desc_template, server,
                      GF_CLIENT_PID_HADOOP, volname, user);
    if (ret == -1)
        return ret;

    ret = parse_mount_pattern_desc(mspec, hadoop_mnt_desc);
    GF_FREE(hadoop_mnt_desc);
    return ret;
}

Version-Release number of selected component (if applicable):
5.3

How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Yaniv Kaul 2019-04-27 17:16:21 UTC
Thanks for the report - would you be able to send a patch to Gluster Gerrit?
How did you find the leak?