diff options
author | Felipe Oliveira Carvalho <felipekde@gmail.com> | 2014-05-08 21:34:46 -0300 |
---|---|---|
committer | Felipe Oliveira Carvalho <felipekde@gmail.com> | 2014-05-19 14:50:23 -0300 |
commit | a80d7e86c1f088c5b68d8e8929cc72a0d9680f76 (patch) | |
tree | cc9cc71ee35fe966779cf6764bd5faabd1186df3 /src/nvim/quickfix.c | |
parent | b63d2626ed9e3e38a485b9990a8e65ba59d6906a (diff) | |
download | rneovim-a80d7e86c1f088c5b68d8e8929cc72a0d9680f76.tar.gz rneovim-a80d7e86c1f088c5b68d8e8929cc72a0d9680f76.tar.bz2 rneovim-a80d7e86c1f088c5b68d8e8929cc72a0d9680f76.zip |
Remove NULL/non-NULL tests after calls to vim_str(n)save()
Diffstat (limited to 'src/nvim/quickfix.c')
-rw-r--r-- | src/nvim/quickfix.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c index 299a0a38db..0e6ed67351 100644 --- a/src/nvim/quickfix.c +++ b/src/nvim/quickfix.c @@ -929,19 +929,14 @@ qf_add_entry ( qfp->qf_fnum = bufnum; else qfp->qf_fnum = qf_get_fnum(dir, fname); - if ((qfp->qf_text = vim_strsave(mesg)) == NULL) { - free(qfp); - return FAIL; - } + qfp->qf_text = vim_strsave(mesg); qfp->qf_lnum = lnum; qfp->qf_col = col; qfp->qf_viscol = vis_col; - if (pattern == NULL || *pattern == NUL) + if (pattern == NULL || *pattern == NUL) { qfp->qf_pattern = NULL; - else if ((qfp->qf_pattern = vim_strsave(pattern)) == NULL) { - free(qfp->qf_text); - free(qfp); - return FAIL; + } else { + qfp->qf_pattern = vim_strsave(pattern); } qfp->qf_nr = nr; if (type != 1 && !vim_isprintc(type)) /* only printable chars allowed */ |