[Bug 238042] Potential memory leak in fts_build of lib/libc/gen/fts-compat.c

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Wed May 22 07:54:00 UTC 2019


            Bug ID: 238042
           Summary: Potential memory leak in fts_build of
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Many People
          Priority: ---
         Component: kern
          Assignee: bugs at FreeBSD.org
          Reporter: yangx92 at hotmail.com

There is a potential memory leak in fts_build of lib/libc/gen/fts-compat.c,
which is the same as bug that was fixed in

fts_build(FTS *sp, int type)
        struct freebsd11_dirent *dp;
        FTSENT *p, *head;


        if (descend && (type == BCHILD || !nitems) &&
            (cur->fts_level == FTS_ROOTLEVEL ?
            FCHDIR(sp, sp->fts_rfd) :
            fts_safe_changedir(sp, cur->fts_parent, -1, ".."))) {
                cur->fts_info = FTS_ERR;
                return (NULL);  //memory leak here

        if (!nitems) {
                if (type == BREAD)
                        cur->fts_info = FTS_DP;
                return (NULL);  //memory leak here

You are receiving this mail because:
You are the assignee for the bug.

More information about the freebsd-bugs mailing list