mirror of
https://github.com/neovim/neovim.git
synced 2025-09-24 20:18:32 +00:00
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.
beb9cb19c6
This commit is contained in:
@@ -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"));
|
di = tv_dict_item_alloc_len(S_LEN("context"));
|
||||||
if (di != NULL) {
|
if (di != NULL) {
|
||||||
tv_copy(qi->qf_lists[qf_idx].qf_ctx, &di->di_tv);
|
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 {
|
} else {
|
||||||
status = tv_dict_add_str(retdict, S_LEN("context"), "");
|
status = tv_dict_add_str(retdict, S_LEN("context"), "");
|
||||||
|
Reference in New Issue
Block a user