From a6474943065ab3dd285f9011165309262e0d215b Mon Sep 17 00:00:00 2001 From: Alex Taber Date: Thu, 24 Dec 2020 18:27:48 -0500 Subject: [PATCH] Fix another null dereference --- source/loading.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/source/loading.c b/source/loading.c index 84dbd58..0963154 100644 --- a/source/loading.c +++ b/source/loading.c @@ -410,9 +410,12 @@ static bool load_icons(Entry_List_s * current_list, Handle mutex) int index = indexes[i]; C2D_Image * image = icons[index]; - C3D_TexDelete(image->tex); - free(image->tex); - free(image); + if (icons[index] != NULL) + { + C3D_TexDelete(image->tex); + free(image->tex); + free(image); + } icons[index] = load_entry_icon(*current_entry);