diff options
author | Jakub Jelinek <jakub@redhat.com> | 2005-05-03 09:28:32 +0000 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2005-05-03 09:28:32 +0000 |
commit | eec65e81e75bc0af8212e59a281b52d920607fc8 (patch) | |
tree | 6b9c5f1795a1062c593a4f1cfb3cc92b8eb90970 /nis/nis_removemember.c | |
parent | a0971eefb70ea4bf2c240f8b33926dde1dfbeb09 (diff) | |
download | glibc-eec65e81e75bc0af8212e59a281b52d920607fc8.tar glibc-eec65e81e75bc0af8212e59a281b52d920607fc8.tar.gz glibc-eec65e81e75bc0af8212e59a281b52d920607fc8.tar.bz2 glibc-eec65e81e75bc0af8212e59a281b52d920607fc8.zip |
Updated to fedora-glibc-20050503T0852
Diffstat (limited to 'nis/nis_removemember.c')
-rw-r--r-- | nis/nis_removemember.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/nis/nis_removemember.c b/nis/nis_removemember.c index b9e27ab48c..122c3022ff 100644 --- a/nis/nis_removemember.c +++ b/nis/nis_removemember.c @@ -1,4 +1,4 @@ -/* Copyright (c) 1997, 1998, 1999, 2004 Free Software Foundation, Inc. +/* Copyright (c) 1997, 1998, 1999, 2004, 2005 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1997. @@ -92,9 +92,13 @@ nis_removemember (const_nis_name member, const_nis_name group) /* This realloc() call always decreases the size. This cannot fail. We still have the test but do not recover memory (i.e., we overwrite the input pointer). */ - newmem = realloc (newmem, k * sizeof (char*)); - if (newmem == NULL) - return NIS_NOMEMORY; + nis_name *newp = realloc (newmem, k * sizeof (char*)); + if (newp == NULL) + { + free (newmem); + return NIS_NOMEMORY; + } + newmem = newp; NIS_RES_OBJECT (res)->GR_data.gr_members.gr_members_val = newmem; NIS_RES_OBJECT (res)->GR_data.gr_members.gr_members_len = k; |