Skip to content

Commit

Permalink
patch 8.2.4472: Coverity warns for use of a freed function name
Browse files Browse the repository at this point in the history
Problem:    Coverity warns for use of a freed function name.
Solution:   Only check an autoload name when is prefixed.
  • Loading branch information
brammool committed Feb 25, 2022
1 parent 62628d9 commit 9383a3a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/userfunc.c
Expand Up @@ -4624,7 +4624,7 @@ define_function(exarg_T *eap, char_u *name_arg, garray_T *lines_to_free)
{
char_u *prefixed = may_prefix_autoload(name);

if (prefixed != NULL)
if (prefixed != NULL && prefixed != name)
{
v = find_var(prefixed, &ht, TRUE);
if (v != NULL)
Expand Down
2 changes: 2 additions & 0 deletions src/version.c
Expand Up @@ -754,6 +754,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
4472,
/**/
4471,
/**/
Expand Down

0 comments on commit 9383a3a

Please sign in to comment.