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

patch 8.2.3291: Coverity warns for not checking return value

Problem:    Coverity warns for not checking return value.
Solution:   If dict_add() fails give an error message.
This commit is contained in:
Bram Moolenaar
2021-08-05 15:11:08 +02:00
parent 9fe17d473a
commit 4a01159da2
3 changed files with 8 additions and 1 deletions

View File

@@ -1862,7 +1862,8 @@ luaV_setvar(lua_State *L)
return 0;
// Update the value
copy_tv(&tv, &di->di_tv);
dict_add(dict, di);
if (dict_add(dict, di) == FAIL)
return luaL_error(L, "Couldn't add to dictionary");
} else
{
// Clear the old value