mesa/main: Add missing null check in _mesa_CreatePerfQueryINTEL()
authorJuha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Mon, 12 May 2014 08:01:48 +0000 (11:01 +0300)
committerTapani Pälli <tapani.palli@intel.com>
Fri, 30 May 2014 04:22:01 +0000 (07:22 +0300)
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Petri Latvala <petri.latvala@intel.com>
src/mesa/main/performance_monitor.c

index 21b9423e003274d380de3968fd76b84fc75ae98b..9d1a6b4d807e9a72524969d42944f0582f646657 100644 (file)
@@ -1036,6 +1036,11 @@ _mesa_CreatePerfQueryINTEL(GLuint queryId, GLuint *queryHandle)
    }
 
    m = new_performance_monitor(ctx, first);
+   if (m == NULL) {
+      _mesa_error_no_memory(__func__);
+      return;
+   }
+
    _mesa_HashInsert(ctx->PerfMonitor.Monitors, first, m);
    *queryHandle = first;