Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1167629

Summary: [rpc.gssd] code defect: resource leak: utils/gssd/gssd_main_loop.c : topdirs_init_list
Product: Red Hat Enterprise Linux 7 Reporter: JianHong Yin <jiyin>
Component: nfs-utilsAssignee: Steve Dickson <steved>
Status: CLOSED ERRATA QA Contact: Yongcheng Yang <yoyang>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 7.1CC: xzhou
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: nfs-utils-1.3.0-0.68.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-09-29 20:29:55 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 JianHong Yin 2014-11-25 08:03:55 UTC
Description of problem:
[rpc.gssd] code defect: resource leak in utils/gssd/gssd_main_loop.c : topdirs_init_list

Version-Release number of selected component (if applicable):
nfs-utils-1.3.0-0.1 nfs-utils-1.3.0-0.5

How reproducible:
always

Steps to Reproduce:
1. Covscan and code review

Actual results:
static int
topdirs_init_list(void)
{
        DIR             *pipedir;
        struct dirent   *dent;
        int             ret;

        TAILQ_INIT(&topdirs_list);

        pipedir = opendir(pipefs_dir);
        if (pipedir == NULL) {
                printerr(0, "ERROR: could not open rpc_pipefs directory '%s': "
                         "%s\n", pipefs_dir, strerror(errno));
                return -1;
        }
        for (dent = readdir(pipedir); dent != NULL; dent = readdir(pipedir)) {
                if (dent->d_type != DT_DIR ||
                    strcmp(dent->d_name, ".") == 0  ||
                    strcmp(dent->d_name, "..") == 0) {
                        continue;
                }
                ret = topdirs_add_entry(dent);
                if (ret)
                        goto out_err;
        }
        if (TAILQ_EMPTY(&topdirs_list)) {
                printerr(0, "ERROR: rpc_pipefs directory '%s' is empty!\n", pipefs_dir);
                ^^^^^ before return, not free DIR object: pipedir

                return -1;
        }
        closedir(pipedir);
        return 0;
out_err:
        topdirs_free_list();

        ^^^^^ before return, not free DIR object: pipedir
        return -1;
}

Expected results:
  no resource leak

Additional info:
  ~

Comment 3 Murphy Zhou 2020-05-14 05:46:44 UTC
Is this still relevant?

Comment 10 errata-xmlrpc 2020-09-29 20:29:55 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (nfs-utils bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:4002