aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nvim/eval.c5
-rw-r--r--src/nvim/memline.c11
-rw-r--r--src/nvim/misc1.c2
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);