Merge pull request #4065 from lioncash/leak

drm_gfx: Fix a memory leak in the initialization fail case
This commit is contained in:
Twinaphex 2016-11-25 18:23:38 +01:00 committed by GitHub
commit 33a9132c8d

View File

@ -728,10 +728,13 @@ static void *drm_gfx_init(const video_info_t *video,
if (!init_drm()) if (!init_drm())
{ {
RARCH_ERR ("DRM: Failed to initialize DRM\n"); RARCH_ERR ("DRM: Failed to initialize DRM\n");
free(_drmvars);
return NULL; return NULL;
} }
else else
RARCH_LOG ("DRM: Init succesful.\n"); {
RARCH_LOG ("DRM: Init successful.\n");
}
_drmvars->kms_width = drm.current_mode->hdisplay; _drmvars->kms_width = drm.current_mode->hdisplay;
_drmvars->kms_height = drm.current_mode->vdisplay; _drmvars->kms_height = drm.current_mode->vdisplay;