NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

misc/50710: src/distrib/utils/more/os.c:240]: (error) Memory leak: cmd



>Number:         50710
>Category:       misc
>Synopsis:       src/distrib/utils/more/os.c:240]: (error) Memory leak: cmd
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    misc-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Jan 26 08:55:00 +0000 2016
>Originator:     David Binderman
>Release:        cvs dated 20160125
>Organization:
>Environment:
>Description:
Source code is

    if ((f = popen(cmd, "r")) == NULL)
        return (filename);

Something like

    if ((f = popen(cmd, "r")) == NULL)
    {
        free(cmd);
        return (filename);
    }

might be a suitable replacement.
>How-To-Repeat:

>Fix:



Home | Main Index | Thread Index | Old Index