diff options
author | Nathan Scott <nathans@redhat.com> | 2023-09-01 09:40:51 +1000 |
---|---|---|
committer | Nathan Scott <nathans@redhat.com> | 2023-09-04 08:59:51 +1000 |
commit | de1d3e17aff864a58cb7f6da6efff7b7bde6182a (patch) | |
tree | 41110e071957d870e898571b39220152bedbfad6 /Settings.c | |
parent | 66c0b19ed6fec2afd4ed381665274fa83c67660e (diff) |
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.
Diffstat (limited to 'Settings.c')
-rw-r--r-- | Settings.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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); } |