]> granicus.if.org Git - vim/commitdiff
patch 7.4.939 v7.4.939
authorBram Moolenaar <Bram@vim.org>
Tue, 24 Nov 2015 16:23:56 +0000 (17:23 +0100)
committerBram Moolenaar <Bram@vim.org>
Tue, 24 Nov 2015 16:23:56 +0000 (17:23 +0100)
Problem:    Memory leak when encountering a syntax error.
Solution:   Free the memory. (Dominique Pelle)

src/ex_docmd.c
src/version.c

index 23514fb124c65e144b1018c951be22dbd68774d5..31b51e99d62b8c7b91888d14ad8de13e68faaeb8 100644 (file)
@@ -12117,6 +12117,7 @@ ex_match(eap)
        if (*p == NUL)
        {
            /* There must be two arguments. */
+           vim_free(g);
            EMSG2(_(e_invarg2), eap->arg);
            return;
        }
@@ -12125,11 +12126,13 @@ ex_match(eap)
        {
            if (*end != NUL && !ends_excmd(*skipwhite(end + 1)))
            {
+               vim_free(g);
                eap->errmsg = e_trailing;
                return;
            }
            if (*end != *p)
            {
+               vim_free(g);
                EMSG2(_(e_invarg2), p);
                return;
            }
index c89c2633f3c5a88b10269ab1c9a8d596980c5cda..a411fd88280cfb59b5f7beb383cd9a9519f6590a 100644 (file)
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    939,
 /**/
     938,
 /**/