0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 9.0.0373: Coverity warns for NULL check and unused return value

Problem:    Coverity warns for NULL check and unused return value.
Solution:   Remove the NULL check, it was already checked earlier.  Add (void)
            to ignore the return value.
This commit is contained in:
Bram Moolenaar
2022-09-04 11:42:22 +01:00
parent 5fbbec180b
commit a5348f241b
3 changed files with 5 additions and 4 deletions

View File

@@ -862,7 +862,7 @@ add_defer_func(int var_idx, int argcount, ectx_T *ectx)
if (defer_tv->v_type != VAR_LIST)
{
// first one, allocate the list
// first time, allocate the list
if (rettv_list_alloc(defer_tv) == FAIL)
return FAIL;
}
@@ -874,8 +874,7 @@ add_defer_func(int var_idx, int argcount, ectx_T *ectx)
listval.v_type = VAR_LIST;
listval.vval.v_list = l;
listval.v_lock = 0;
if (list_insert_tv(defer_l, &listval,
defer_l == NULL ? NULL : defer_l->lv_first) == FAIL)
if (list_insert_tv(defer_l, &listval, defer_l->lv_first) == FAIL)
{
vim_free(l);
return FAIL;