This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Fix for inet_ntoa.c
- To: libc-alpha at sources dot redhat dot com
- Subject: Fix for inet_ntoa.c
- From: Andreas Jaeger <aj at suse dot de>
- Date: Tue, 14 Aug 2001 13:41:55 +0200
- Cc: Dylan Alex Simon <dylan at dylex dot caltech dot edu>
Dylan reported a bug with mtrace:
$ cat pr2477.c
int main() {
mtrace();
printf("%s\n", inet_ntoa(0x12345678));
}
gee:~/tmp:[0]$ MALLOC_TRACE=mtrace.out ./a.out
120.86.52.18
Segmentation fault
Since we use in inet_ntoa now thread specific memory static_buf is
never dynamically allocated and therefore should not be freed.
Ok to commit?
Andreas
2001-08-14 Andreas Jaeger <aj@suse.de>
* inet/inet_ntoa.c (free_mem): Remove, it's not used anymore.
Closes PR libc/2477, reported by Dylan Alex Simon
<dylan@dylex.caltech.edu>.
--- inet/inet_ntoa.c.~1~ Fri Jul 6 18:23:36 2001
+++ inet/inet_ntoa.c Tue Aug 14 13:30:51 2001
@@ -1,5 +1,5 @@
/* Convert Inet number to ASCII representation.
- Copyright (C) 1997, 1998, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1998, 2000, 2001 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -96,11 +96,3 @@
free (mem);
__libc_setspecific (key, NULL);
}
-
-
-static void __attribute__ ((unused))
-free_mem (void)
-{
- free (static_buf);
-}
-text_set_element (__libc_subfreeres, free_mem);
--
Andreas Jaeger
SuSE Labs aj@suse.de
private aj@arthur.inka.de
http://www.suse.de/~aj