Bug 14104

Summary: Unfreed memory in sysdeps/unix/sysv/linux/check_pf.c
Product: glibc Reporter: H.J. Lu <hjl.tools>
Component: libcAssignee: Not yet assigned to anyone <unassigned>
Status: RESOLVED FIXED    
Severity: normal CC: drepper.fsp
Priority: P2 Flags: fweimer: security-
Version: unspecified   
Target Milestone: 2.16   
Host: Target:
Build: Last reconfirmed:

Description H.J. Lu 2012-05-13 16:07:07 UTC
Since cache isn't freed in sysdeps/unix/sysv/linux/check_pf.c,

"make xcheck" reports:

[hjl@gnu-6 build-x86_64-linux]$ cat posix/bug-ga2-mem 

Memory not freed:
-----------------
           Address     Size     Caller
0x00005555557791e0     0x78  at 0x7ffff7d5d989
[hjl@gnu-6 build-x86_64-linux]$ 

We should add

/* Make sure cache is freed before exiting.  */
libc_freeres_fn (freecache)
{
  if (cache)
    free (cache);
}

or

/* Make sure cache is freed before exiting.  */
libc_freeres_fn (freecache)
{
  free (cache);
}
Comment 1 Ulrich Drepper 2012-05-13 23:11:11 UTC
libc_freeres_ptr
Comment 2 H.J. Lu 2012-05-14 19:54:14 UTC
Fixed.