summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2001-06-08 20:11:03 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2001-06-08 20:11:03 +0000
commitc334f11fddd43817463ed5eec4e8e0c062a578aa (patch)
tree4018550cf3011846481d97aab28fadf3ede54902
parent12c1538d0ee8deae09f3c2b7db4dcfebd54f5d34 (diff)
add check for NULL malloc (from Stanford metacompilation analysis)
-rw-r--r--src/mesa/main/enums.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mesa/main/enums.c b/src/mesa/main/enums.c
index f4a313a99a..4903ab4451 100644
--- a/src/mesa/main/enums.c
+++ b/src/mesa/main/enums.c
@@ -1,4 +1,4 @@
-/* $Id: enums.c,v 1.9.4.2 2001/01/06 22:43:00 gareth Exp $ */
+/* $Id: enums.c,v 1.9.4.3 2001/06/08 20:11:03 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -863,6 +863,9 @@ static void sort_enums( void )
index1 = (enum_elt **)MALLOC( Elements(all_enums) * sizeof(enum_elt *) );
sorted = 1;
+ if (!index1)
+ return; /* what else can we do? */
+
qsort( all_enums, Elements(all_enums), sizeof(*all_enums),
(cfunc) compar_name );