summaryrefslogtreecommitdiff
path: root/src/if_lua.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-08-05 15:11:08 +0200
committerBram Moolenaar <Bram@vim.org>2021-08-05 15:11:08 +0200
commit4a01159da23a279005b7c5042a15af47eb9617fe (patch)
treeef5772cf3d95d934e5923d5c43e27c500c036c43 /src/if_lua.c
parent9fe17d473a6041e2ea85229f4fa09831d910def4 (diff)
downloadvim-git-4a01159da23a279005b7c5042a15af47eb9617fe.tar.gz
patch 8.2.3291: Coverity warns for not checking return valuev8.2.3291
Problem: Coverity warns for not checking return value. Solution: If dict_add() fails give an error message.
Diffstat (limited to 'src/if_lua.c')
-rw-r--r--src/if_lua.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/if_lua.c b/src/if_lua.c
index bcd0b02f9..144fcbea5 100644
--- a/src/if_lua.c
+++ b/src/if_lua.c
@@ -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