about summary refs log tree commit diff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-04-22 03:30:39 +0000
committerUlrich Drepper <drepper@redhat.com>2000-04-22 03:30:39 +0000
commite88e03a0451bba8f20faadcd5f214810770824f1 (patch)
tree76073e21d4deb629712ad76ede515509352278ae
parentabd8a0b584719ac1d92162e54ca3526789f186d7 (diff)
downloadglibc-e88e03a0451bba8f20faadcd5f214810770824f1.tar.gz
glibc-e88e03a0451bba8f20faadcd5f214810770824f1.tar.xz
glibc-e88e03a0451bba8f20faadcd5f214810770824f1.zip
(nis_print_group_entry): Use alloca instead of malloc.
-rw-r--r--nis/nis_print_group_entry.c24
1 files changed, 9 insertions, 15 deletions
diff --git a/nis/nis_print_group_entry.c b/nis/nis_print_group_entry.c
index e1970dca48..c5aa2abb88 100644
--- a/nis/nis_print_group_entry.c
+++ b/nis/nis_print_group_entry.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 1997, 1998 Free Software Foundation, Inc.
+/* Copyright (c) 1997, 1998, 2000 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1997.
 
@@ -55,18 +55,18 @@ nis_print_group_entry (const_nis_name group)
 	  (__type_of (NIS_RES_OBJECT (res)) != NIS_GROUP_OBJ))
 	return;
 
-      mem_exp = malloc (sizeof (char *) * NIS_RES_NUMOBJ (res));
-      mem_imp = malloc (sizeof (char *) * NIS_RES_NUMOBJ (res));
-      mem_rec = malloc (sizeof (char *) * NIS_RES_NUMOBJ (res));
-      nomem_exp = malloc (sizeof (char *) * NIS_RES_NUMOBJ (res));
-      nomem_imp = malloc (sizeof (char *) * NIS_RES_NUMOBJ (res));
-      nomem_rec = malloc (sizeof (char *) * NIS_RES_NUMOBJ (res));
+      mem_exp = alloca (sizeof (char *) * NIS_RES_NUMOBJ (res));
+      mem_imp = alloca (sizeof (char *) * NIS_RES_NUMOBJ (res));
+      mem_rec = alloca (sizeof (char *) * NIS_RES_NUMOBJ (res));
+      nomem_exp = alloca (sizeof (char *) * NIS_RES_NUMOBJ (res));
+      nomem_imp = alloca (sizeof (char *) * NIS_RES_NUMOBJ (res));
+      nomem_rec = alloca (sizeof (char *) * NIS_RES_NUMOBJ (res));
 
       for (i = 0;
-	 i < NIS_RES_OBJECT (res)->GR_data.gr_members.gr_members_len; ++i)
+	   i < NIS_RES_OBJECT (res)->GR_data.gr_members.gr_members_len; ++i)
 	{
 	  char *grmem =
-	  NIS_RES_OBJECT (res)->GR_data.gr_members.gr_members_val[i];
+	    NIS_RES_OBJECT (res)->GR_data.gr_members.gr_members_val[i];
 	  int neg = grmem[0] == '-';
 
 	  switch (grmem[neg])
@@ -166,12 +166,6 @@ nis_print_group_entry (const_nis_name group)
       else
         fputs (_("    No recursive nonmembers\n"), stdout);
 
-      free (mem_exp);
-      free (mem_imp);
-      free (mem_rec);
-      free (nomem_exp);
-      free (nomem_imp);
-      free (nomem_rec);
       nis_freeresult (res);
     }
 }