summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJuha-Pekka Heikkila <[email protected]>2014-08-01 14:38:17 +0300
committerTapani Pälli <[email protected]>2014-09-23 10:25:02 +0300
commitba089cfa823e991ea53f62d61d087084a8e7381e (patch)
tree1de31db1c1525297be995f7818409f08d3892750 /src
parent51aa22148099f3c7e7e63b77523af629a535fa43 (diff)
i965: Add extra null check in intel_bufferobj_alloc()
Check calloc returned requested memory. Signed-off-by: Juha-Pekka Heikkila <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/i965/intel_buffer_objects.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/intel_buffer_objects.c b/src/mesa/drivers/dri/i965/intel_buffer_objects.c
index 96dacde04fb..0e19e465c4c 100644
--- a/src/mesa/drivers/dri/i965/intel_buffer_objects.c
+++ b/src/mesa/drivers/dri/i965/intel_buffer_objects.c
@@ -136,6 +136,9 @@ static struct gl_buffer_object *
intel_bufferobj_alloc(struct gl_context * ctx, GLuint name, GLenum target)
{
struct intel_buffer_object *obj = CALLOC_STRUCT(intel_buffer_object);
+ if (!obj) {
+ _mesa_error_no_memory(__func__);
+ }
_mesa_initialize_buffer_object(ctx, &obj->Base, name, target);