aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/quickfix.c
diff options
context:
space:
mode:
authorJames McCoy <jamessan@jamessan.com>2017-12-19 10:41:50 -0500
committerJames McCoy <jamessan@jamessan.com>2017-12-19 14:07:24 -0500
commit6fcadab3ce16ff29be53176f8658e61819691df1 (patch)
treee1108e39cc55a479095c55635451ad5e37e7d3e3 /src/nvim/quickfix.c
parent20708a07bfc1de2c56657123c41bb52919a728d8 (diff)
downloadrneovim-6fcadab3ce16ff29be53176f8658e61819691df1.tar.gz
rneovim-6fcadab3ce16ff29be53176f8658e61819691df1.tar.bz2
rneovim-6fcadab3ce16ff29be53176f8658e61819691df1.zip
vim-patch:8.0.0595: Coverity warning for not checking return value
Problem: Coverity warning for not checking return value of dict_add(). Solution: Check the return value for FAIL. https://github.com/vim/vim/commit/beb9cb19c660484488a71a25eda46ab0fa579278
Diffstat (limited to 'src/nvim/quickfix.c')
-rw-r--r--src/nvim/quickfix.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c
index e7d11df833..df735e32a9 100644
--- a/src/nvim/quickfix.c
+++ b/src/nvim/quickfix.c
@@ -4147,7 +4147,9 @@ int get_errorlist_properties(win_T *wp, dict_T *what, dict_T *retdict)
di = tv_dict_item_alloc_len(S_LEN("context"));
if (di != NULL) {
tv_copy(qi->qf_lists[qf_idx].qf_ctx, &di->di_tv);
- tv_dict_add(retdict, di);
+ if (tv_dict_add(retdict, di) == FAIL) {
+ tv_dict_item_free(di);
+ }
}
} else {
status = tv_dict_add_str(retdict, S_LEN("context"), "");