]> granicus.if.org Git - vim/commitdiff
patch 8.0.1492: memory leak in balloon_split() v8.0.1492
authorBram Moolenaar <Bram@vim.org>
Sat, 10 Feb 2018 14:38:35 +0000 (15:38 +0100)
committerBram Moolenaar <Bram@vim.org>
Sat, 10 Feb 2018 14:38:35 +0000 (15:38 +0100)
Problem:    Memory leak in balloon_split().
Solution:   Free the balloon lines. Free the balloon when exiting.

src/evalfunc.c
src/misc2.c
src/version.c

index 632b982de080b66c3093c14db391849eab689e75..4b34538b7b1910da70ba2c38d4fdd527cf39da7c 100644 (file)
@@ -1447,6 +1447,8 @@ f_balloon_split(typval_T *argvars, typval_T *rettv UNUSED)
            /* Skip the first and last item, they are always empty. */
            for (i = 1; i < size - 1; ++i)
                list_append_string(rettv->vval.v_list, array[i].pum_text, -1);
+           while (size > 0)
+               vim_free(array[--size].pum_text);
            vim_free(array);
        }
     }
index 368303ed9e6ff82af57a5b5803ee9cd6b8b9fd67..0deccdf509d375096f8894febaf848b603c380cf 100644 (file)
@@ -1116,6 +1116,10 @@ free_all_mem(void)
     spell_free_all();
 # endif
 
+#if defined(FEAT_INS_EXPAND) && defined(FEAT_BEVAL_TERM)
+    ui_remove_balloon();
+# endif
+
 # if defined(FEAT_USR_CMDS)
     /* Clear user commands (before deleting buffers). */
     ex_comclear(NULL);
index 1bd029555aff8d20a5dc7cad5ffa4ebec36b3cbd..be5f864ecfe31e2ebcc4c0fd24ed980ac1391504 100644 (file)
@@ -771,6 +771,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1492,
 /**/
     1491,
 /**/