0
0
mirror of https://github.com/vim/vim.git synced 2025-09-25 03:54:15 -04:00

patch 8.2.4269: Coverity warns for using a NULL pointer

Problem:    Coverity warns for using a NULL pointer.
Solution:   Check for "name" to not be NULL.
This commit is contained in:
Bram Moolenaar
2022-01-31 11:44:48 +00:00
parent 44d1f89c24
commit 48a604845e
2 changed files with 4 additions and 1 deletions

View File

@@ -4232,7 +4232,8 @@ define_function(exarg_T *eap, char_u *name_arg, garray_T *lines_to_free)
name = prefixed;
}
}
else if (vim9script && vim_strchr(name, AUTOLOAD_CHAR) != NULL)
else if (vim9script && name != NULL
&& vim_strchr(name, AUTOLOAD_CHAR) != NULL)
{
emsg(_(e_cannot_use_name_with_hash_in_vim9_script_use_export_instead));
goto ret_free;