Skip to content

Commit

Permalink
patch 8.2.4076: memory leak in autoload import
Browse files Browse the repository at this point in the history
Problem:    Memory leak in autoload import.
Solution:   Do not overwrite the autoload prefix.
  • Loading branch information
brammool committed Jan 13, 2022
1 parent 78a7053 commit 71930f1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/version.c
Expand Up @@ -750,6 +750,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
4076,
/**/
4075,
/**/
Expand Down
3 changes: 2 additions & 1 deletion src/vim9script.c
Expand Up @@ -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.

This comment has been minimized.

Copy link
@lacygoill

lacygoill Jan 13, 2022

In src/vim9script.c, typo on line 135:

// Store the prefix with the script.  It isused to find exported functions.

A space is missing between is and used:

diff --git a/src/vim9script.c b/src/vim9script.c
index 549c20f40..e01fe482c 100644
--- a/src/vim9script.c
+++ b/src/vim9script.c
@@ -132,7 +132,7 @@ 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.
+    // Store the prefix with the script.  It is used to find exported functions.
     if (si->sn_autoload_prefix == NULL)
 	si->sn_autoload_prefix = get_autoload_prefix(si);
 

This comment has been minimized.

Copy link
@brammool

brammool via email Jan 13, 2022

Author Contributor
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;
Expand Down

0 comments on commit 71930f1

Please sign in to comment.