Memory bug fixed

Andreas Jaeger aj@suse.de
Thu Jul 13 02:59:00 GMT 2000


FYI: While searching for the memory leak in glob in noticed:

- 0000000000 Free 162 was never alloc'd /usr/src/cvs/libc/misc/../sysdeps/unix/sysv/linux/getsysstats.c:287

The appended patch fixes this and has been committed.

Andreas

2000-07-13  Andreas Jaeger  <aj@suse.de>

	* sysdeps/unix/sysv/linux/getsysstats.c (free_mem): Only free
	memory if it was allocated.

============================================================
Index: sysdeps/unix/sysv/linux/getsysstats.c
--- sysdeps/unix/sysv/linux/getsysstats.c	2000/07/06 21:04:09	1.12
+++ sysdeps/unix/sysv/linux/getsysstats.c	2000/07/13 09:48:09
@@ -283,6 +283,7 @@
 static void
 free_mem (void)
 {
-  free (mount_proc);
+  if (mount_proc != NULL)
+    free (mount_proc);
 }
 text_set_element (__libc_subfreeres, free_mem);

-- 
 Andreas Jaeger
  SuSE Labs aj@suse.de
   private aj@arthur.inka.de


More information about the Libc-hacker mailing list