[Mesa-dev] [PATCH 2/9] i965: check malloc return value in intel_resolve_map_set()
Juha-Pekka Heikkila
juhapekka.heikkila at gmail.com
Thu Jul 3 01:13:12 PDT 2014
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila at gmail.com>
---
src/mesa/drivers/dri/i965/intel_resolve_map.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/mesa/drivers/dri/i965/intel_resolve_map.c b/src/mesa/drivers/dri/i965/intel_resolve_map.c
index bf6bcf2..bb45231 100644
--- a/src/mesa/drivers/dri/i965/intel_resolve_map.c
+++ b/src/mesa/drivers/dri/i965/intel_resolve_map.c
@@ -22,6 +22,7 @@
*/
#include "intel_resolve_map.h"
+#include "main/imports.h"
#include <assert.h>
#include <stdlib.h>
@@ -46,6 +47,11 @@ intel_resolve_map_set(struct exec_list *resolve_map,
}
struct intel_resolve_map *m = malloc(sizeof(struct intel_resolve_map));
+ if (m == NULL) {
+ _mesa_error_no_memory(__func__);
+ return;
+ }
+
exec_node_init(&m->link);
m->level = level;
m->layer = layer;
--
1.8.1.2
More information about the mesa-dev
mailing list