Bug 14104 - Unfreed memory in sysdeps/unix/sysv/linux/check_pf.c
Summary: Unfreed memory in sysdeps/unix/sysv/linux/check_pf.c
Status: RESOLVED FIXED
Alias: None
Product: glibc
Classification: Unclassified
Component: libc (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: 2.16
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-13 16:07 UTC by H.J. Lu
Modified: 2014-06-25 11:01 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:
fweimer: security-


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.