From c08ca2964955290e1b69f3f8177517074c99a61e Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Mon, 6 May 2019 10:01:49 +0200 Subject: [PATCH] PVS/V547: Expression is always false --- src/nvim/quickfix.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c index 269c4d43ca..be643a6062 100644 --- a/src/nvim/quickfix.c +++ b/src/nvim/quickfix.c @@ -1442,15 +1442,13 @@ static int qf_add_entry(qf_info_T *qi, int qf_idx, char_u *dir, char_u *fname, } if (module == NULL || *module == NUL) { qfp->qf_module = NULL; - } else if ((qfp->qf_module = vim_strsave(module)) == NULL) { - xfree(qfp->qf_text); - xfree(qfp->qf_pattern); - xfree(qfp); - return QF_FAIL; + } else { + qfp->qf_module = vim_strsave(module); } qfp->qf_nr = nr; - if (type != 1 && !vim_isprintc(type)) /* only printable chars allowed */ + if (type != 1 && !vim_isprintc(type)) { // only printable chars allowed type = 0; + } qfp->qf_type = (char_u)type; qfp->qf_valid = valid;