1
0
forked from aniani/vim

patch 9.0.0368: old Coverity warning for using NULL pointer

Problem:    Old Coverity warning for using NULL pointer.
Solution:   Bail out if dictionary allocation fails.
This commit is contained in:
Bram Moolenaar
2022-09-03 12:59:19 +01:00
parent 0a6bb59f6b
commit 89083466fa
2 changed files with 6 additions and 0 deletions

View File

@@ -4384,7 +4384,11 @@ get_tags(list_T *list, char_u *pat, char_u *buf_fname)
}
if ((dict = dict_alloc()) == NULL)
{
ret = FAIL;
vim_free(matches[i]);
break;
}
if (list_append_dict(list, dict) == FAIL)
ret = FAIL;