]> granicus.if.org Git - vim/commitdiff
patch 8.2.4076: memory leak in autoload import v8.2.4076
authorBram Moolenaar <Bram@vim.org>
Thu, 13 Jan 2022 13:47:43 +0000 (13:47 +0000)
committerBram Moolenaar <Bram@vim.org>
Thu, 13 Jan 2022 13:47:43 +0000 (13:47 +0000)
Problem:    Memory leak in autoload import.
Solution:   Do not overwrite the autoload prefix.

src/version.c
src/vim9script.c

index ba6e5da087b09f85b946d506c95885f1edfe66b5..06d71fd7881c8cb54e1e9c2c134047c14c7c4846 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    4076,
 /**/
     4075,
 /**/
index 6d02be6adc98b057d9065bdbfed1f121dce2a9f7..549c20f402bddcc70b44ed31509371f76899eb61 100644 (file)
@@ -133,7 +133,8 @@ ex_vim9script(exarg_T *eap UNUSED)
     si->sn_state = SN_STATE_HAD_COMMAND;
 
     // Store the prefix with the script.  It isused to find exported functions.
-    si->sn_autoload_prefix = get_autoload_prefix(si);
+    if (si->sn_autoload_prefix == NULL)
+       si->sn_autoload_prefix = get_autoload_prefix(si);
 
     current_sctx.sc_version = SCRIPT_VERSION_VIM9;
     si->sn_version = SCRIPT_VERSION_VIM9;