(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,6 +325,7 @@ static void free_drm_resources(gfx_ctx_drm_data_t *drm)
|
|||
|
||||
drm_free();
|
||||
|
||||
if (drm->drm)
|
||||
if (g_drm_fd >= 0)
|
||||
filestream_close(drm->drm);
|
||||
|
||||
|
|
|
@ -79,6 +79,7 @@ bool video_shader_driver_get_prev_textures(video_shader_ctx_texture_t *texture)
|
|||
{
|
||||
if (!!texture || !current_shader)
|
||||
{
|
||||
if (texture)
|
||||
texture->id = 0;
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue