gbm/dri: Fix out-of-memory error path in dri_device_create()
authorAnder Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Tue, 8 Apr 2014 20:28:38 +0000 (23:28 +0300)
committerEmil Velikov <emil.l.velikov@gmail.com>
Fri, 25 Apr 2014 20:16:00 +0000 (21:16 +0100)
Cc: "10.0" "10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
src/gbm/backends/dri/gbm_dri.c

index 50fa588ff39374c04b80f34e9673ef0e536ccca5..f6818366b17bbc9ee9ae63a93126113f4310957d 100644 (file)
@@ -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;