From bb978fa69ccab4b5b764ac025274145291cea3ca Mon Sep 17 00:00:00 2001 From: Felipe Oliveira Carvalho Date: Wed, 28 May 2014 23:02:04 -0300 Subject: No OOM in save_cmdline_alloc() --- src/nvim/ex_getln.c | 6 ++---- src/nvim/getchar.c | 4 ---- 2 files changed, 2 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c index 994b2f510f..96731f6a1a 100644 --- a/src/nvim/ex_getln.c +++ b/src/nvim/ex_getln.c @@ -2307,10 +2307,8 @@ char_u *save_cmdline_alloc(void) */ void restore_cmdline_alloc(char_u *p) { - if (p != NULL) { - restore_cmdline((struct cmdline_info *)p); - free(p); - } + restore_cmdline((struct cmdline_info *)p); + free(p); } /* diff --git a/src/nvim/getchar.c b/src/nvim/getchar.c index 57b0cf9a31..972ac9a0ec 100644 --- a/src/nvim/getchar.c +++ b/src/nvim/getchar.c @@ -3724,10 +3724,6 @@ eval_map_expr ( vim_unescape_csi(expr); save_cmd = save_cmdline_alloc(); - if (save_cmd == NULL) { - free(expr); - return NULL; - } /* Forbid changing text or using ":normal" to avoid most of the bad side * effects. Also restore the cursor position. */ -- cgit