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

in update_history(), fix minor memory leak

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3996 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
parent 6642e885
Showing with 4 additions and 1 deletion
+4 -1
...@@ -15,6 +15,9 @@ CVS code - ...@@ -15,6 +15,9 @@ CVS code -
consistency. (DLR) consistency. (DLR)
- Rename NANO_ALT_.* and NANO_.*ALTKEY to NANO_META_.* and - Rename NANO_ALT_.* and NANO_.*ALTKEY to NANO_META_.* and
NANO_.*METAKEY, for consistency. (DLR) NANO_.*METAKEY, for consistency. (DLR)
- search.c:
update_history()
- Fix minor memory leak. (DLR)
- text.c: - text.c:
do_spell() do_spell()
- When setting i to the return value of write_(marked_)?file(), - When setting i to the return value of write_(marked_)?file(),
......
...@@ -1342,7 +1342,7 @@ void update_history(filestruct **h, const char *s) ...@@ -1342,7 +1342,7 @@ void update_history(filestruct **h, const char *s)
} }
/* Add the new entry to the end. */ /* Add the new entry to the end. */
(*hbot)->data = mallocstrcpy(NULL, s); (*hbot)->data = mallocstrcpy((*hbot)->data, s);
splice_node(*hbot, make_new_node(*hbot), (*hbot)->next); splice_node(*hbot, make_new_node(*hbot), (*hbot)->next);
*hbot = (*hbot)->next; *hbot = (*hbot)->next;
(*hbot)->data = mallocstrcpy(NULL, ""); (*hbot)->data = mallocstrcpy(NULL, "");
......
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