diff options
author | Eliseo Martínez <eliseomarmol@gmail.com> | 2014-12-14 22:19:23 +0100 |
---|---|---|
committer | Eliseo Martínez <eliseomarmol@gmail.com> | 2014-12-16 21:01:22 +0100 |
commit | a97f9e9594225f8078847311fd23b7c339b9f6bc (patch) | |
tree | 2392c4640fd37a4b285f6d026b4392275454b4a5 | |
parent | 9b1c9393709a42e6999e4c29f7d0249ae9d8b7be (diff) | |
download | rneovim-a97f9e9594225f8078847311fd23b7c339b9f6bc.tar.gz rneovim-a97f9e9594225f8078847311fd23b7c339b9f6bc.tar.bz2 rneovim-a97f9e9594225f8078847311fd23b7c339b9f6bc.zip |
coverity/13696: Unchecked return value: RI.
Problem : Unchecked return value (CHECKED_RETURN) @ 2644.
Diagnostic : Real issue.
Rationale : Other `u_save` invocations are checked, and there's no
reason to think this invocation could not fail.
Resolution : Check and return if failed (other previous checks in the
same function just return, without reporting error, so
we just do the same).
-rw-r--r-- | src/nvim/ops.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/nvim/ops.c b/src/nvim/ops.c index a6dee2be5b..931b877a95 100644 --- a/src/nvim/ops.c +++ b/src/nvim/ops.c @@ -30,6 +30,7 @@ #include "nvim/fold.h" #include "nvim/getchar.h" #include "nvim/indent.h" +#include "nvim/log.h" #include "nvim/mark.h" #include "nvim/mbyte.h" #include "nvim/memline.h" @@ -2641,7 +2642,10 @@ do_put ( /* Autocommands may be executed when saving lines for undo, which may make * y_array invalid. Start undo now to avoid that. */ - u_save(curwin->w_cursor.lnum, curwin->w_cursor.lnum + 1); + if (u_save(curwin->w_cursor.lnum, curwin->w_cursor.lnum + 1) == FAIL) { + ELOG(_("Failed to save undo information")); + return; + } if (insert_string != NULL) { y_type = MCHAR; |