diff src/ex_docmd.c @ 7262:fadf7fc3b666 v7.4.939

commit https://github.com/vim/vim/commit/9a7d58e42ed54406437c2394e5a489ee6a9e4220 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Nov 24 17:23:56 2015 +0100 patch 7.4.939 Problem: Memory leak when encountering a syntax error. Solution: Free the memory. (Dominique Pelle)
author Christian Brabandt <cb@256bit.org>
date Tue, 24 Nov 2015 17:30:05 +0100
parents 0f2807c05687
children 1886f2863437
line wrap: on
line diff
--- 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;
 	    }