diff src/userfunc.c @ 27092:6d063974af23 v8.2.4075

patch 8.2.4075: test failures Commit: https://github.com/vim/vim/commit/78a70533c3707aa50cbf998c7807221945aa9787 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Jan 13 13:24:34 2022 +0000 patch 8.2.4075: test failures Problem: Test failures. Solution: Change check for NULL pointer.
author Bram Moolenaar <Bram@vim.org>
date Thu, 13 Jan 2022 14:30:04 +0100
parents 3956e3bb47ec
children 98a01021e465
line wrap: on
line diff
--- a/src/userfunc.c
+++ b/src/userfunc.c
@@ -4152,13 +4152,11 @@ define_function(exarg_T *eap, char_u *na
 	    else
 		eap->skip = TRUE;
 	}
-	if (name == NULL)
-	    goto ret_free;  // out of memory
 
 	// For "export def FuncName()" in an autoload script the function name
 	// is stored with the legacy autoload name "dir#script#FuncName" so
 	// that it can also be found in legacy script.
-	if (is_export)
+	if (is_export && name != NULL)
 	    name = may_prefix_autoload(name);
     }