summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2001-06-08 20:10:55 +0000
committerBrian Paul <[email protected]>2001-06-08 20:10:55 +0000
commit0ce9f39d237bf86dc50d2822dafde3d6bdc279e1 (patch)
tree882a6f79c2fce19035e1dbc3d4677639f1432e3c /src/mesa
parent5fd13173a1f8863761de835611f6f4026ffac654 (diff)
add check for NULL malloc (from Stanford metacompilation analysis)
Diffstat (limited to 'src/mesa')
-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 7fe9d94c161..9d5a567742a 100644
--- a/src/mesa/main/enums.c
+++ b/src/mesa/main/enums.c
@@ -1,4 +1,4 @@
-/* $Id: enums.c,v 1.19 2001/04/30 21:08:51 keithw Exp $ */
+/* $Id: enums.c,v 1.20 2001/06/08 20:10:55 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -875,6 +875,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 );