]> git.wh0rd.org Git - nano.git/commitdiff
free magichistory when we don't need it anymore
authorDavid Lawrence Ramsey <pooka109@gmail.com>
Mon, 23 May 2005 17:14:46 +0000 (17:14 +0000)
committerDavid Lawrence Ramsey <pooka109@gmail.com>
Mon, 23 May 2005 17:14:46 +0000 (17:14 +0000)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2534 35c25a1d-7b9e-4130-9fde-d3aeb78583b8

src/winio.c

index 96f56cff36d19510238c6b30dacc57e164f9d860..54b13db6540db64123b04f4a10c12aa44980b830 100644 (file)
@@ -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;
 }