comparison src/ex_docmd.c @ 6965:86d43639de31 v7.4.800

patch 7.4.800 Problem: Using freed memory when triggering CmdUndefined autocommands. Solution: Set pointer to NULL. (Dominique Pelle)
author Bram Moolenaar <bram@vim.org>
date Tue, 28 Jul 2015 14:25:48 +0200
parents 1efa7c2b9368
children 1661dd8df592
comparison
equal deleted inserted replaced
6964:6c62ad33faf2 6965:86d43639de31
2363 while (ASCII_ISALNUM(*p)) 2363 while (ASCII_ISALNUM(*p))
2364 ++p; 2364 ++p;
2365 p = vim_strnsave(ea.cmd, (int)(p - ea.cmd)); 2365 p = vim_strnsave(ea.cmd, (int)(p - ea.cmd));
2366 ret = apply_autocmds(EVENT_CMDUNDEFINED, p, p, TRUE, NULL); 2366 ret = apply_autocmds(EVENT_CMDUNDEFINED, p, p, TRUE, NULL);
2367 vim_free(p); 2367 vim_free(p);
2368 if (ret && !aborting()) 2368 /* If the autocommands did something and didn't cause an error, try
2369 p = find_command(&ea, NULL); 2369 * finding the command again. */
2370 p = (ret && !aborting()) ? find_command(&ea, NULL) : NULL;
2370 } 2371 }
2371 #endif 2372 #endif
2372 2373
2373 #ifdef FEAT_USR_CMDS 2374 #ifdef FEAT_USR_CMDS
2374 if (p == NULL) 2375 if (p == NULL)