summaryrefslogtreecommitdiff
path: root/src/userfunc.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-02-25 21:35:17 +0000
committerBram Moolenaar <Bram@vim.org>2022-02-25 21:35:17 +0000
commit9383a3afb6a2b7ba6a2739a66a68cc8e1162f389 (patch)
treeb1fb74464fc1e6b3783448cce52a97c0d45797f8 /src/userfunc.c
parent62628d97c4690462ca54781fd16bbfc7ad31477b (diff)
downloadvim-git-9383a3afb6a2b7ba6a2739a66a68cc8e1162f389.tar.gz
patch 8.2.4472: Coverity warns for use of a freed function namev8.2.4472
Problem: Coverity warns for use of a freed function name. Solution: Only check an autoload name when is prefixed.
Diffstat (limited to 'src/userfunc.c')
-rw-r--r--src/userfunc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/userfunc.c b/src/userfunc.c
index ed2fb8668..03b310d67 100644
--- a/src/userfunc.c
+++ b/src/userfunc.c
@@ -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)