0
0
mirror of https://github.com/vim/vim.git synced 2025-09-29 04:34:16 -04:00

patch 8.1.1707: Coverity warns for possibly using a NULL pointer

Problem:    Coverity warns for possibly using a NULL pointer.
Solution:   Change the logic to make sure no NULL pointer is used.
This commit is contained in:
Bram Moolenaar
2019-07-17 21:27:52 +02:00
parent 99a764bccd
commit cfdbc5adde
3 changed files with 9 additions and 4 deletions

View File

@@ -587,14 +587,13 @@ apply_general_options(win_T *wp, dict_T *dict)
di = dict_find(dict, (char_u *)"mask", -1);
if (di != NULL)
{
int ok = TRUE;
int ok = FALSE;
if (di->di_tv.v_type != VAR_LIST)
ok = FALSE;
else if (di->di_tv.vval.v_list != NULL)
if (di->di_tv.v_type == VAR_LIST && di->di_tv.vval.v_list != NULL)
{
listitem_T *li;
ok = TRUE;
for (li = di->di_tv.vval.v_list->lv_first; li != NULL;
li = li->li_next)
{