mirror of
https://github.com/CTCaer/RetroArch.git
synced 2025-01-19 01:12:33 +00:00
frontend/history.c: Prevent possible null dereference of hist
This commit is contained in:
parent
958e2ee0b1
commit
7e0d06b47b
@ -111,8 +111,14 @@ void rom_history_push(rom_history_t *hist,
|
||||
static void rom_history_write_file(rom_history_t *hist)
|
||||
{
|
||||
size_t i;
|
||||
FILE *file = fopen(hist->conf_path, "w");
|
||||
if (!file || !hist)
|
||||
FILE *file = NULL;
|
||||
|
||||
if (!hist)
|
||||
return;
|
||||
|
||||
file = fopen(hist->conf_path, "w");
|
||||
|
||||
if (!file)
|
||||
return;
|
||||
|
||||
for (i = 0; i < hist->size; i++)
|
||||
|
Loading…
x
Reference in New Issue
Block a user