# HG changeset patch # User Bram Moolenaar # Date 1438086348 -7200 # Node ID 86d43639de31ba99947cf9bfe0a3fd171ca7019e # Parent 6c62ad33faf2519738c69da4ebf49930f2f7700f patch 7.4.800 Problem: Using freed memory when triggering CmdUndefined autocommands. Solution: Set pointer to NULL. (Dominique Pelle) diff --git a/src/ex_docmd.c b/src/ex_docmd.c --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -2365,8 +2365,9 @@ do_one_cmd(cmdlinep, sourcing, p = vim_strnsave(ea.cmd, (int)(p - ea.cmd)); ret = apply_autocmds(EVENT_CMDUNDEFINED, p, p, TRUE, NULL); vim_free(p); - if (ret && !aborting()) - p = find_command(&ea, NULL); + /* If the autocommands did something and didn't cause an error, try + * finding the command again. */ + p = (ret && !aborting()) ? find_command(&ea, NULL) : NULL; } #endif diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -742,6 +742,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 800, +/**/ 799, /**/ 798,