summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-09-09 16:25:54 +0200
committerBram Moolenaar <Bram@vim.org>2017-09-09 16:25:54 +0200
commit09d6c3818d7451a659f4d12a4e974237fe823f7d (patch)
treed4ee7440b6536afb67018b5b2ed30e3a2dd036da
parentb4ea1914b8ca7c368253bd96e6b3cb9e3392da1c (diff)
patch 8.0.1079: memory leak when remote_foreground() failsv8.0.1079
Problem: Memory leak when remote_foreground() fails. Solution: Free the error message.
-rw-r--r--src/evalfunc.c5
-rw-r--r--src/if_xcmdsrv.c1
-rw-r--r--src/version.c2
3 files changed, 8 insertions, 0 deletions
diff --git a/src/evalfunc.c b/src/evalfunc.c
index a2542e2c5e..ea342b4c65 100644
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -8638,7 +8638,10 @@ remote_common(typval_T *argvars, typval_T *rettv, int expr)
# endif
{
if (r != NULL)
+ {
EMSG(r); /* sending worked but evaluation failed */
+ vim_free(r);
+ }
else
EMSG2(_("E241: Unable to send to %s"), server_name);
return;
@@ -8698,6 +8701,8 @@ f_remote_foreground(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
argvars[1].v_type = VAR_STRING;
argvars[1].vval.v_string = vim_strsave((char_u *)"foreground()");
argvars[2].v_type = VAR_UNKNOWN;
+ rettv->v_type = VAR_STRING;
+ rettv->vval.v_string = NULL;
remote_common(argvars, rettv, TRUE);
vim_free(argvars[1].vval.v_string);
# endif
diff --git a/src/if_xcmdsrv.c b/src/if_xcmdsrv.c
index 4c3c012202..2d87e30501 100644
--- a/src/if_xcmdsrv.c
+++ b/src/if_xcmdsrv.c
@@ -420,6 +420,7 @@ serverSendToVim(
{
LookupName(dpy, loosename ? loosename : name,
/*DELETE=*/TRUE, NULL);
+ vim_free(loosename);
continue;
}
}
diff --git a/src/version.c b/src/version.c
index 4ef0d9ee71..94ba24dbbe 100644
--- a/src/version.c
+++ b/src/version.c
@@ -770,6 +770,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1079,
+/**/
1078,
/**/
1077,