From: Bram Moolenaar Date: Tue, 24 Nov 2015 16:23:56 +0000 (+0100) Subject: patch 7.4.939 X-Git-Tag: v7.4.939 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9a7d58e42ed54406437c2394e5a489ee6a9e4220;p=vim patch 7.4.939 Problem: Memory leak when encountering a syntax error. Solution: Free the memory. (Dominique Pelle) --- diff --git a/src/ex_docmd.c b/src/ex_docmd.c index 23514fb12..31b51e99d 100644 --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -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; } diff --git a/src/version.c b/src/version.c index c89c2633f..a411fd882 100644 --- a/src/version.c +++ b/src/version.c @@ -741,6 +741,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 939, /**/ 938, /**/