To: vim_dev@googlegroups.com Subject: Patch 8.0.1079 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.0.1079 Problem: Memory leak when remote_foreground() fails. Solution: Free the error message. Files: src/evalfunc.c, src/if_xcmdsrv.c *** ../vim-8.0.1078/src/evalfunc.c 2017-09-08 14:39:25.642102863 +0200 --- src/evalfunc.c 2017-09-09 15:01:09.769950325 +0200 *************** *** 8638,8644 **** --- 8638,8647 ---- # 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,8703 **** --- 8701,8708 ---- 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 *** ../vim-8.0.1078/src/if_xcmdsrv.c 2017-03-19 21:20:45.885034380 +0100 --- src/if_xcmdsrv.c 2017-09-09 15:10:17.490195547 +0200 *************** *** 420,425 **** --- 420,426 ---- { LookupName(dpy, loosename ? loosename : name, /*DELETE=*/TRUE, NULL); + vim_free(loosename); continue; } } *** ../vim-8.0.1078/src/version.c 2017-09-09 15:28:08.146515551 +0200 --- src/version.c 2017-09-09 16:25:24.906743248 +0200 *************** *** 771,772 **** --- 771,774 ---- { /* Add new patch number below this line */ + /**/ + 1079, /**/ -- There's no place like $(HOME)! /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///