From 9a7d58e42ed54406437c2394e5a489ee6a9e4220 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 24 Nov 2015 17:23:56 +0100 Subject: [PATCH] patch 7.4.939 Problem: Memory leak when encountering a syntax error. Solution: Free the memory. (Dominique Pelle) --- src/ex_docmd.c | 3 +++ src/version.c | 2 ++ 2 files changed, 5 insertions(+) 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, /**/ -- 2.50.1