src/video/kmsdrm/SDL_kmsdrmvideo.c
changeset 11190 478630f6b756
parent 11186 a01f9b70ff97
child 11217 d9c3f934bd0e
     1.1 --- a/src/video/kmsdrm/SDL_kmsdrmvideo.c	Sat Aug 05 22:10:25 2017 +0200
     1.2 +++ b/src/video/kmsdrm/SDL_kmsdrmvideo.c	Sat Aug 05 22:10:36 2017 +0200
     1.3 @@ -199,6 +199,10 @@
     1.4  
     1.5      /* Here a new DRM FB must be created */
     1.6      fb_info = (KMSDRM_FBInfo *)SDL_calloc(1, sizeof(KMSDRM_FBInfo));
     1.7 +    if (fb_info == NULL) {
     1.8 +        SDL_OutOfMemory();
     1.9 +        return NULL;
    1.10 +    }
    1.11      fb_info->drm_fd = vdata->drm_fd;
    1.12  
    1.13      w  = KMSDRM_gbm_bo_get_width(bo);
    1.14 @@ -280,6 +284,10 @@
    1.15  
    1.16      /* Open /dev/dri/cardNN */
    1.17      devname = (char *) SDL_calloc(1, 16);
    1.18 +    if (devname == NULL) {
    1.19 +        ret = SDL_OutOfMemory();
    1.20 +        goto cleanup;
    1.21 +    }
    1.22      SDL_snprintf(devname, 16, "/dev/dri/card%d", vdata->devindex);
    1.23      vdata->drm_fd = open(devname, O_RDWR | O_CLOEXEC);
    1.24      SDL_free(devname);