[Mesa-dev] [PATCH 1/2] glx: Add missing null check in __glXNewIndirectAPI()

Juha-Pekka Heikkila juhapekka.heikkila at gmail.com
Fri Jan 3 04:57:33 PST 2014


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 at gmail.com>
---
 src/mapi/glapi/gen/glX_proto_send.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/mapi/glapi/gen/glX_proto_send.py b/src/mapi/glapi/gen/glX_proto_send.py
index f4d519f..8b80441 100644
--- a/src/mapi/glapi/gen/glX_proto_send.py
+++ b/src/mapi/glapi/gen/glX_proto_send.py
@@ -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++) {
-- 
1.8.1.2



More information about the mesa-dev mailing list