From: David Lawrence Ramsey Date: Mon, 23 May 2005 17:14:46 +0000 (+0000) Subject: free magichistory when we don't need it anymore X-Git-Tag: v1.3.8~269 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=2fba43c842d3d744ad16b194b21b38f28b5ba5ae;p=nano.git free magichistory when we don't need it anymore git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2534 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- diff --git a/src/winio.c b/src/winio.c index 96f56cff..54b13db6 100644 --- a/src/winio.c +++ b/src/winio.c @@ -2569,10 +2569,14 @@ int nanogetstr(bool allow_tabs, const char *buf, const char *curranswer, } /* We finished putting in an answer or ran a normal shortcut's - * associated function, so reset statusbar_x. */ + * associated function, so free msgichistory if we need to and reset + * statusbar_x. */ if (kbinput == NANO_CANCEL_KEY || kbinput == NANO_ENTER_KEY || - ran_func) + ran_func) { + if (magichistory != NULL) + free(magichistory); statusbar_x = (size_t)-1; + } return kbinput; }