mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 04:20:08 +01:00
add check for NULL malloc (from Stanford metacompilation analysis)
This commit is contained in:
parent
5fd13173a1
commit
0ce9f39d23
1 changed files with 4 additions and 1 deletions
|
|
@ -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 );
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue