diff options
author | Eliseo Martínez <eliseomarmol@gmail.com> | 2015-01-23 14:38:39 +0100 |
---|---|---|
committer | Eliseo Martínez <eliseomarmol@gmail.com> | 2015-01-27 01:33:34 +0100 |
commit | 00f18e2e09af35494d0b94ae76a9dbc3e0319d89 (patch) | |
tree | e30a14192b64404578e415e2929888d57cd49fc7 | |
parent | 883e3a7a73ec246b3534bae9340b6c4e89c4c467 (diff) | |
download | rneovim-00f18e2e09af35494d0b94ae76a9dbc3e0319d89.tar.gz rneovim-00f18e2e09af35494d0b94ae76a9dbc3e0319d89.tar.bz2 rneovim-00f18e2e09af35494d0b94ae76a9dbc3e0319d89.zip |
Remove nonnullret deadcode: xmalloc.
-rw-r--r-- | src/nvim/eval.c | 5 | ||||
-rw-r--r-- | src/nvim/memline.c | 11 | ||||
-rw-r--r-- | src/nvim/misc1.c | 2 |
3 files changed, 5 insertions, 13 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 639d406896..a4bd4d89ef 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -18162,8 +18162,7 @@ void func_dump_profile(FILE *fd) --todo; fp = HI2UF(hi); if (fp->uf_profiling) { - if (sorttab != NULL) - sorttab[st_len++] = fp; + sorttab[st_len++] = fp; if (fp->uf_name[0] == K_SPECIAL) fprintf(fd, "FUNCTION <SNR>%s()\n", fp->uf_name + 3); @@ -18190,7 +18189,7 @@ void func_dump_profile(FILE *fd) } } - if (sorttab != NULL && st_len > 0) { + if (st_len > 0) { qsort((void *)sorttab, (size_t)st_len, sizeof(ufunc_T *), prof_total_cmp); prof_sort_list(fd, sorttab, st_len, "TOTAL", FALSE); diff --git a/src/nvim/memline.c b/src/nvim/memline.c index 1fa6d6acc6..29b372e057 100644 --- a/src/nvim/memline.c +++ b/src/nvim/memline.c @@ -1240,10 +1240,8 @@ theend: mf_put(mfp, hp, false, false); mf_close(mfp, false); /* will also free(mfp->mf_fname) */ } - if (buf != NULL) { - free(buf->b_ml.ml_stack); - free(buf); - } + free(buf->b_ml.ml_stack); + free(buf); if (serious_error && called_from_main) ml_close(curbuf, TRUE); else { @@ -3279,10 +3277,7 @@ findswapname ( /* * we try different names until we find one that does not exist yet */ - if (dir_name == NULL) /* out of memory */ - fname = NULL; - else - fname = makeswapname(buf_fname, buf->b_ffname, buf, dir_name); + fname = makeswapname(buf_fname, buf->b_ffname, buf, dir_name); for (;; ) { if (fname == NULL) /* must be out of memory */ diff --git a/src/nvim/misc1.c b/src/nvim/misc1.c index aa4d2b38db..383e2bf6a5 100644 --- a/src/nvim/misc1.c +++ b/src/nvim/misc1.c @@ -3466,8 +3466,6 @@ get_cmd_output ( i = (int)fread((char *)buffer, (size_t)1, (size_t)len, fd); fclose(fd); os_remove((char *)tempname); - if (buffer == NULL) - goto done; if (i != len) { EMSG2(_(e_notread), tempname); free(buffer); |