Skip to content

Commit b0d12e6

Browse files
k-takatabrammool
authored andcommitted
patch 9.0.0413: ASAN reports a memory leak
Problem: ASAN reports a memory leak. Solution: Free the string received from the server. (Ken Takata, closes #11080)
1 parent e5a420f commit b0d12e6

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/clientserver.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -423,9 +423,7 @@ cmdsrv_main(
423423
if (argtype == ARGTYPE_EDIT_WAIT)
424424
{
425425
int numFiles = *argc - i - 1;
426-
int j;
427426
char_u *done = alloc(numFiles);
428-
char_u *p;
429427
# ifdef FEAT_GUI_MSWIN
430428
NOTIFYICONDATA ni;
431429
int count = 0;
@@ -450,6 +448,8 @@ cmdsrv_main(
450448
vim_memset(done, 0, numFiles);
451449
while (memchr(done, 0, numFiles) != NULL)
452450
{
451+
char_u *p;
452+
int j;
453453
# ifdef MSWIN
454454
p = serverGetReply(srv, NULL, TRUE, TRUE, 0);
455455
if (p == NULL)
@@ -459,6 +459,7 @@ cmdsrv_main(
459459
break;
460460
# endif
461461
j = atoi((char *)p);
462+
vim_free(p);
462463
if (j >= 0 && j < numFiles)
463464
{
464465
# ifdef FEAT_GUI_MSWIN

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -703,6 +703,8 @@ static char *(features[]) =
703703

704704
static int included_patches[] =
705705
{ /* Add new patch number below this line */
706+
/**/
707+
413,
706708
/**/
707709
412,
708710
/**/

0 commit comments

Comments
 (0)