glx: Add missing null check in __glXNewIndirectAPI()
authorJuha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Fri, 3 Jan 2014 12:57:00 +0000 (05:57 -0700)
committerBrian Paul <brianp@vmware.com>
Mon, 6 Jan 2014 17:23:12 +0000 (10:23 -0700)
Add extra null check in auto generated indirect_init.c via
src/mapi/glapi/gen/glX_proto_send.py

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
src/mapi/glapi/gen/glX_proto_send.py

index f4d519f144ace100cef28f82617ec5fbbc3bfc17..8b804418bc5e7f0ec9fa855ff3293ba9ee6d9517 100644 (file)
@@ -971,6 +971,8 @@ struct _glapi_table * __glXNewIndirectAPI( void )
 
     entries = _glapi_get_dispatch_table_size();
     table = malloc(entries * sizeof(_glapi_proc));
+    if (table == NULL)
+        return NULL;
 
     /* first, set all entries to point to no-op functions */
     for (i = 0; i < entries; i++) {