]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 8.2.4472: Coverity warns for use of a freed function name v8.2.4472
authorBram Moolenaar <Bram@vim.org>
Fri, 25 Feb 2022 21:35:17 +0000 (21:35 +0000)
committerBram Moolenaar <Bram@vim.org>
Fri, 25 Feb 2022 21:35:17 +0000 (21:35 +0000)
Problem:    Coverity warns for use of a freed function name.
Solution:   Only check an autoload name when is prefixed.

src/userfunc.c
src/version.c

index ed2fb8668cc1179a537b13248cb7b3a1be9d868b..03b310d67bd18ad7f3fbe7d57f8244e3f5fd9fca 100644 (file)
@@ -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)
index 1531a9c18be844d05c053b9baa8a9fd9da3fd878..e0384c8ef0d9708f858b73b3aa554ea394c12f3b 100644 (file)
@@ -754,6 +754,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    4472,
 /**/
     4471,
 /**/