mirror of
https://github.com/libretro/RetroArch
synced 2025-01-30 03:32:46 +00:00
(DRM) Prevent double free and prevent dereference before NULL check
This commit is contained in:
parent
d5d2f7f8ee
commit
c17315cd27
@ -511,10 +511,11 @@ database_info_list_t *database_info_list_new(
|
||||
database_info_list->count = k;
|
||||
|
||||
end:
|
||||
database_cursor_close(db, cur);
|
||||
|
||||
if (db)
|
||||
{
|
||||
database_cursor_close(db, cur);
|
||||
libretrodb_free(db);
|
||||
}
|
||||
if (cur)
|
||||
libretrodb_cursor_free(cur);
|
||||
|
||||
|
@ -325,8 +325,9 @@ static void free_drm_resources(gfx_ctx_drm_data_t *drm)
|
||||
|
||||
drm_free();
|
||||
|
||||
if (g_drm_fd >= 0)
|
||||
filestream_close(drm->drm);
|
||||
if (drm->drm)
|
||||
if (g_drm_fd >= 0)
|
||||
filestream_close(drm->drm);
|
||||
|
||||
g_gbm_surface = NULL;
|
||||
g_gbm_dev = NULL;
|
||||
|
@ -79,7 +79,8 @@ bool video_shader_driver_get_prev_textures(video_shader_ctx_texture_t *texture)
|
||||
{
|
||||
if (!!texture || !current_shader)
|
||||
{
|
||||
texture->id = 0;
|
||||
if (texture)
|
||||
texture->id = 0;
|
||||
return false;
|
||||
}
|
||||
texture->id = current_shader->get_prev_textures(shader_data);
|
||||
|
Loading…
x
Reference in New Issue
Block a user