Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 Jun 2018 19:56:17 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 229020] Potential memory leak in sbin/umount
Message-ID:  <bug-229020-227@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D229020

            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: bugs@FreeBSD.org
          Reporter: thomas.barabosch@fkie.fraunhofer.de

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

There may be a potential memory leak in sbin/umount. In function umountfs t=
here
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() fun=
c-
     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 freeaddrinf=
o().
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.

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-229020-227>