Commit e5bc1c45 authored by David Lawrence Ramsey's avatar David Lawrence Ramsey
Browse files

oops; free magichistory *properly* when we don't need it anymore

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2535 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
parent 2fba43c8
Showing with 8 additions and 6 deletions
+8 -6
...@@ -2568,15 +2568,17 @@ int nanogetstr(bool allow_tabs, const char *buf, const char *curranswer, ...@@ -2568,15 +2568,17 @@ int nanogetstr(bool allow_tabs, const char *buf, const char *curranswer,
wrefresh(bottomwin); wrefresh(bottomwin);
} }
/* We finished putting in an answer or ran a normal shortcut's #ifndef NANO_SMALL
* associated function, so free msgichistory if we need to and reset /* Free msgichistory if we need to. */
* statusbar_x. */
if (kbinput == NANO_CANCEL_KEY || kbinput == NANO_ENTER_KEY ||
ran_func) {
if (magichistory != NULL) if (magichistory != NULL)
free(magichistory); free(magichistory);
#endif
/* We finished putting in an answer or ran a normal shortcut's
* associated function, so reset statusbar_x. */
if (kbinput == NANO_CANCEL_KEY || kbinput == NANO_ENTER_KEY ||
ran_func)
statusbar_x = (size_t)-1; statusbar_x = (size_t)-1;
}
return kbinput; return kbinput;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment