From: David Lawrence Ramsey Date: Wed, 13 Dec 2006 00:27:45 +0000 (+0000) Subject: in update_history(), fix minor memory leak X-Git-Tag: v2.0.2~9 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=b513778b567a803d4299ea2d570780dbc9f485d2;p=nano.git in update_history(), fix minor memory leak git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3996 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- diff --git a/ChangeLog b/ChangeLog index 6af15c5a..93de95a7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -15,6 +15,9 @@ CVS code - consistency. (DLR) - Rename NANO_ALT_.* and NANO_.*ALTKEY to NANO_META_.* and NANO_.*METAKEY, for consistency. (DLR) +- search.c: + update_history() + - Fix minor memory leak. (DLR) - text.c: do_spell() - When setting i to the return value of write_(marked_)?file(), diff --git a/src/search.c b/src/search.c index 402f37d6..435826e4 100644 --- a/src/search.c +++ b/src/search.c @@ -1342,7 +1342,7 @@ void update_history(filestruct **h, const char *s) } /* 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); *hbot = (*hbot)->next; (*hbot)->data = mallocstrcpy(NULL, "");