https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=229020

            Bug ID: 229020
           Summary: Potential memory leak in sbin/umount
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Many People
          Priority: ---
         Component: bin
          Assignee: b...@freebsd.org
          Reporter: thomas.barabo...@fkie.fraunhofer.de

Created attachment 194258
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=194258&action=edit
Possible patch

There may be a potential memory leak in sbin/umount. In function umountfs there
is a call to getaddrinfo. According to getaddrinfo.3:

"All of the     information returned by getaddrinfo() is dynamically allo-
     cated: the addrinfo structures themselves as well as the socket address
     structures and the canonical host name strings included in the addrinfo
     structures.

     Memory allocated for the dynamically allocated structures created by a
     successful call to getaddrinfo() is released by the freeaddrinfo() func-
     tion.  The ai pointer should be a addrinfo structure created by a call to
     getaddrinfo()."

However, the whole file umount.c does not make a single call to freeaddrinfo().
It would be better to free the addrinfo with freeaddrinfo to prevent a
potential memory leak.

Can you confirm this problem?

I've attached a patch as a possible solution.

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
freebsd-bugs@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"

Reply via email to