aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZyX <kp-pav@yandex.ru>2018-04-22 18:56:29 +0300
committerZyX <kp-pav@yandex.ru>2018-04-22 18:57:34 +0300
commit3ee187b770cd9b736b70225ac81efadc5e51962d (patch)
tree55be73cecdee26603f465829694f3ba16ca25c78
parent4d43ce85f187a9d6deed9266098dd82fec07be23 (diff)
downloadrneovim-3ee187b770cd9b736b70225ac81efadc5e51962d.tar.gz
rneovim-3ee187b770cd9b736b70225ac81efadc5e51962d.tar.bz2
rneovim-3ee187b770cd9b736b70225ac81efadc5e51962d.zip
quickfix: Fix PVS/V547: allocator never returns NULL now
-rw-r--r--src/nvim/quickfix.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c
index a44a305f22..1f69565403 100644
--- a/src/nvim/quickfix.c
+++ b/src/nvim/quickfix.c
@@ -3626,7 +3626,7 @@ void ex_vimgrep(exarg_T *eap)
&& eap->cmdidx != CMD_vimgrepadd && eap->cmdidx != CMD_lvimgrepadd)
|| qi->qf_curlist == qi->qf_listcount) {
// make place for a new list
- qf_new_list(qi, title != NULL ? title : *eap->cmdlinep);
+ qf_new_list(qi, title);
}
/* parse the list of arguments */
@@ -4205,11 +4205,9 @@ int get_errorlist_properties(win_T *wp, dict_T *what, dict_T *retdict)
if ((status == OK) && (flags & QF_GETLIST_CONTEXT)) {
if (qi->qf_lists[qf_idx].qf_ctx != NULL) {
di = tv_dict_item_alloc_len(S_LEN("context"));
- if (di != NULL) {
- tv_copy(qi->qf_lists[qf_idx].qf_ctx, &di->di_tv);
- if (tv_dict_add(retdict, di) == FAIL) {
- tv_dict_item_free(di);
- }
+ tv_copy(qi->qf_lists[qf_idx].qf_ctx, &di->di_tv);
+ if (tv_dict_add(retdict, di) == FAIL) {
+ tv_dict_item_free(di);
}
} else {
status = tv_dict_add_str(retdict, S_LEN("context"), "");