Problem: Using freed memory when triggering CmdUndefined autocommands.
Solution: Set pointer to NULL. (Dominique Pelle)
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
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 800,
/**/
799,
/**/