From 458901c61e1f756a33b94c3851fc70a947eb2d29 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Fri, 29 Apr 2005 09:19:34 +0000 Subject: * nis/nis_table.c: Fix realloc handling. * nis/nis_removemember.c: Likewise. --- nis/nis_table.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'nis/nis_table.c') diff --git a/nis/nis_table.c b/nis/nis_table.c index 13acdfd..2531a3f 100644 --- a/nis/nis_table.c +++ b/nis/nis_table.c @@ -1,4 +1,4 @@ -/* Copyright (c) 1997, 1998, 1999, 2003, 2004 Free Software Foundation, Inc. +/* Copyright (c) 1997,1998,1999,2003,2004,2005 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Thorsten Kukuk , 1997. @@ -94,9 +94,10 @@ __create_ib_request (const_nis_name name, unsigned int flags) if ((search_len + 1) >= size) { size += 1; - search_val = realloc (search_val, size * sizeof (nis_attr)); - if (search_val == NULL) + nis_attr *newp = realloc (search_val, size * sizeof (nis_attr)); + if (newp == NULL) goto free_null; + search_val = newp; } search_val[search_len].zattr_ndx = strdup (key); if ((search_val[search_len].zattr_ndx) == NULL) -- cgit v1.1