]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 7.4.1597 v7.4.1597
authorBram Moolenaar <Bram@vim.org>
Sat, 19 Mar 2016 13:22:11 +0000 (14:22 +0100)
committerBram Moolenaar <Bram@vim.org>
Sat, 19 Mar 2016 13:22:11 +0000 (14:22 +0100)
Problem:    Memory leak when out of memory. (Coverity)
Solution:   Free the name.

src/eval.c
src/version.c

index 5fc4bd4ff329a569c152d8e78b941d46ab53bc9b..a2288f9f277b5305ef2e54a915207868ddcb4a3e 100644 (file)
@@ -11904,7 +11904,9 @@ f_function(typval_T *argvars, typval_T *rettv)
            partial_T   *pt = (partial_T *)alloc_clear(sizeof(partial_T));
 
            /* result is a VAR_PARTIAL */
-           if (pt != NULL)
+           if (pt == NULL)
+               vim_free(name);
+           else
            {
                if (arg_idx > 0 || (arg_pt != NULL && arg_pt->pt_argc > 0))
                {
index 081d14c46fc8f4b204af5125d67145df3508a051..4d0c25046b34f4e562dd99f141ea2a3b84a1fc55 100644 (file)
@@ -748,6 +748,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1597,
 /**/
     1596,
 /**/