0
0
mirror of https://github.com/vim/vim.git synced 2025-07-26 11:04:33 -04:00

patch 8.2.0172: Coverity warning for not restoring character

Problem:    Coverity warning for not restoring character.
Solution:   Restore the character also in case of failure.
This commit is contained in:
Bram Moolenaar 2020-01-28 23:13:42 +01:00
parent 9a5e5a3e33
commit 4549ece47c
2 changed files with 4 additions and 3 deletions

View File

@ -742,6 +742,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
172,
/**/ /**/
171, 171,
/**/ /**/

View File

@ -358,15 +358,14 @@ handle_import(char_u *arg_start, garray_T *gap, int import_sid)
} }
sv = NULL; sv = NULL;
} }
*arg = cc;
arg = skipwhite(arg);
imported = new_imported(gap != NULL ? gap imported = new_imported(gap != NULL ? gap
: &SCRIPT_ITEM(import_sid)->sn_imports); : &SCRIPT_ITEM(import_sid)->sn_imports);
if (imported == NULL) if (imported == NULL)
return NULL; return NULL;
*arg = cc;
arg = skipwhite(arg);
// TODO: check for "as" following // TODO: check for "as" following
// imported->imp_name = vim_strnsave(as_ptr, as_len); // imported->imp_name = vim_strnsave(as_ptr, as_len);
imported->imp_name = vim_strnsave(name, name_len); imported->imp_name = vim_strnsave(name, name_len);