[Bug 297619] sysutils/consolekit2: Fix CkProcessStat leak when process lookup fails

[email protected]
Newsgroups gmane.os.freebsd.devel.ports.bugs
Message-ID <[email protected]/bugzilla/>
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=297619

            Bug ID: 297619
           Summary: sysutils/consolekit2: Fix CkProcessStat leak when
                    process lookup fails
           Product: Ports & Packages
           Version: Latest
          Hardware: amd64
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: Individual Port(s)
          Assignee: [email protected]
          Reporter: [email protected]
             Flags: maintainer-feedback?([email protected])
          Assignee: [email protected]

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

The FreeBSD backend of sysutils/consolekit2 leaks a CkProcessStat allocation
whenever ck_process_stat_new_for_unix_pid() fails  
  to obtain information about the requested process.

  The function allocates proc with g_new0() and passes it to stat2proc(). On
success, ownership is returned to the caller. On     
  failure, however, the function sets *stat to NULL without freeing proc.

  stat2proc() can fail when the kern.proc.pid sysctl fails, for example if the
process exits during the lookup. Repeated failures 
  in the long-running ConsoleKit daemon can therefore accumulate leaked
allocations.

  The attached patch calls g_free(proc) on the failure path before setting
*stat to NULL. The successful ownership path remains   
  unchanged.

-- 
You are receiving this mail because:
You are the assignee for the bug.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.