From de1d3e17aff864a58cb7f6da6efff7b7bde6182a Mon Sep 17 00:00:00 2001 From: Nathan Scott Date: Fri, 1 Sep 2023 09:40:51 +1000 Subject: Ensure possible NULL pointer values dealt with defensively Coverity scanning shows a couple of locations where a NULL pointer dereference could happen; updated code to ensure it cannot. --- Settings.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Settings.c') diff --git a/Settings.c b/Settings.c index 5265ce4d..16e1044f 100644 --- a/Settings.c +++ b/Settings.c @@ -543,9 +543,10 @@ static bool Settings_read(Settings* this, const char* fileName, unsigned int ini if (screen) screen->allBranchesCollapsed = atoi(option[1]); } else if (String_eq(option[0], ".dynamic")) { - if (screen) + if (screen) { free_and_xStrdup(&screen->dynamic, option[1]); - Platform_addDynamicScreen(screen); + Platform_addDynamicScreen(screen); + } } String_freeArray(option); } -- cgit v1.2.3