mirror of
https://github.com/neovim/neovim.git
synced 2025-09-28 14:08:32 +00:00
No OOM in save_cmdline_alloc()
This commit is contained in:
@@ -2307,11 +2307,9 @@ char_u *save_cmdline_alloc(void)
|
|||||||
*/
|
*/
|
||||||
void restore_cmdline_alloc(char_u *p)
|
void restore_cmdline_alloc(char_u *p)
|
||||||
{
|
{
|
||||||
if (p != NULL) {
|
|
||||||
restore_cmdline((struct cmdline_info *)p);
|
restore_cmdline((struct cmdline_info *)p);
|
||||||
free(p);
|
free(p);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* paste a yank register into the command line.
|
* paste a yank register into the command line.
|
||||||
|
@@ -3724,10 +3724,6 @@ eval_map_expr (
|
|||||||
vim_unescape_csi(expr);
|
vim_unescape_csi(expr);
|
||||||
|
|
||||||
save_cmd = save_cmdline_alloc();
|
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
|
/* Forbid changing text or using ":normal" to avoid most of the bad side
|
||||||
* effects. Also restore the cursor position. */
|
* effects. Also restore the cursor position. */
|
||||||
|
Reference in New Issue
Block a user