diff options
author | Brian Paul <brian.paul@tungstengraphics.com> | 2001-06-08 20:11:03 +0000 |
---|---|---|
committer | Brian Paul <brian.paul@tungstengraphics.com> | 2001-06-08 20:11:03 +0000 |
commit | c334f11fddd43817463ed5eec4e8e0c062a578aa (patch) | |
tree | 4018550cf3011846481d97aab28fadf3ede54902 | |
parent | 12c1538d0ee8deae09f3c2b7db4dcfebd54f5d34 (diff) |
add check for NULL malloc (from Stanford metacompilation analysis)
-rw-r--r-- | src/mesa/main/enums.c | 5 |
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 ); |