Prevent use after free in definemacro().
authorflorian <florian@openbsd.org>
Sun, 12 Apr 2015 21:42:18 +0000 (21:42 +0000)
committerflorian <florian@openbsd.org>
Sun, 12 Apr 2015 21:42:18 +0000 (21:42 +0000)
commit04dc4095f6bf5b1b8ea785d1ec84f674c03b97c3
tree461e9e9836426a2f047e1be189dea196cfd39fae
parent2844feb15f11e8b72fe128754144766f07b81999
Prevent use after free in definemacro().
When the startup file contains (start-kbd-macro) mg crashes when
executing "start-kbd-macro" two times in the running mg.

The problem is that execline() is cleaning up behind our backs.
Finish the cleanup and make sure mg doesn't think we are in the
middle of a macro definition.

Problem found, tracked down and diff by gsoares@
Tweaked & OK by me.
Committing on request of gsoares@ who currently doesn't have good net
to commit.
usr.bin/mg/extend.c