From aa91fe1c09e066751c5419adb7810745336bd051 Mon Sep 17 00:00:00 2001 From: Ander Conselvan de Oliveira Date: Tue, 8 Apr 2014 23:28:38 +0300 Subject: [PATCH] gbm/dri: Fix out-of-memory error path in dri_device_create() Cc: "10.0" "10.1" Reviewed-by: Emil Velikov --- src/gbm/backends/dri/gbm_dri.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gbm/backends/dri/gbm_dri.c b/src/gbm/backends/dri/gbm_dri.c index 50fa588ff39..f6818366b17 100644 --- a/src/gbm/backends/dri/gbm_dri.c +++ b/src/gbm/backends/dri/gbm_dri.c @@ -722,6 +722,8 @@ dri_device_create(int fd) int ret; dri = calloc(1, sizeof *dri); + if (!dri) + return NULL; dri->base.base.fd = fd; dri->base.base.bo_create = gbm_dri_bo_create; -- 2.30.2