]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - inet/getnetgrent.c
Update copyright notices with scripts/update-copyrights
[thirdparty/glibc.git] / inet / getnetgrent.c
index d464c10cdea59be9b49b2bc4e2f6983c6bc18ca7..2bcc5e5f6eba4e425495d8b76b25566aa3474221 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1997, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2014 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
    Lesser General Public License for more details.
 
    You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   02111-1307 USA.  */
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
 
 #include <errno.h>
 #include <netdb.h>
 #include <stdlib.h>
 #include <bits/libc-lock.h>
 
-/* Statis buffer for return value.  We allocate it when needed.  */
-static char *buffer;
+/* Static buffer for return value.  We allocate it when needed.  */
+libc_freeres_ptr (static char *buffer);
 /* All three strings should fit in a block of 1kB size.  */
 #define BUFSIZE 1024
 
@@ -48,15 +47,3 @@ getnetgrent (char **hostp, char **userp, char **domainp)
 
   return __getnetgrent_r (hostp, userp, domainp, buffer, BUFSIZE);
 }
-
-
-/* Make sure the memory is freed if the programs ends while in
-   memory-debugging mode and something actually was allocated.  */
-static void
-__attribute__ ((unused))
-free_mem (void)
-{
-  free (buffer);
-}
-
-text_set_element (__libc_subfreeres, free_mem);