PATCH: Free cache in sysdeps/unix/sysv/linux/check_pf.c

H.J. Lu hongjiu.lu@intel.com
Sat May 12 16:28:00 GMT 2012


Hi,

"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 didn't free cache in sysdeps/unix/sysv/linux/check_pf.c.  This patch
fixes it.  OK to install?

Thanks.

H.J.
---
2012-05-12  H.J. Lu  <hongjiu.lu@intel.com>

	* sysdeps/unix/sysv/linux/check_pf.c (freecache): New function.

diff --git a/sysdeps/unix/sysv/linux/check_pf.c b/sysdeps/unix/sysv/linux/check_pf.c
index 7d83906..9e889f1 100644
--- a/sysdeps/unix/sysv/linux/check_pf.c
+++ b/sysdeps/unix/sysv/linux/check_pf.c
@@ -429,3 +429,10 @@ __free_in6ai (struct in6addrinfo *ai)
 	}
     }
 }
+
+/* Make sure cache is freed before exiting.  */
+libc_freeres_fn (freecache)
+{
+  if (cache)
+    free (cache);
+}



More information about the Libc-alpha mailing list