Bug 201730 - usr/src/usr.sbin/edquota/edquota.c: multiple resource leak ?
Summary: usr/src/usr.sbin/edquota/edquota.c: multiple resource leak ?
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: misc (show other bugs)
Version: 10.2-STABLE
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-07-21 07:21 UTC by David Binderman
Modified: 2015-07-21 07:21 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Binderman 2015-07-21 07:21:40 UTC
1.

[usr/src/usr.sbin/edquota/edquota.c:558]: (error) Resource leak: fd

    while (fgets(line1, sizeof (line1), fd) != NULL &&
           fgets(line2, sizeof (line2), fd) != NULL) {
        if ((fsp = strtok(line1, " \t:")) == NULL) {
            warnx("%s: bad format", line1);
            return (0);
        }

More of the same in the while loop.

2.

[usr/src/usr.sbin/edquota/edquota.c:736]: (error) Resource leak: fd

    while (fgets(line1, sizeof (line1), fd) != NULL) {
        if ((fsp = strtok(line1, " \t:")) == NULL) {
            warnx("%s: bad format", line1);
            return (0);
        }

Similar code to the above case.