commit 9ceeabda3893c2938e9e36599b3628ab2448f1d6
parent 204e1b83534652ba8dc4b8e31b72bf5a30e01213
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Wed, 7 Feb 2018 19:27:50 +0100
memory: avoid a leak when toggling from Search to Goto
This fixes https://savannah.gnu.org/bugs/?53088.
Diffstat:
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/prompt.c b/src/prompt.c
@@ -615,7 +615,8 @@ int do_prompt(bool allow_tabs, bool allow_files,
bottombars(menu);
- answer = mallocstrcpy(answer, curranswer);
+ if (answer != curranswer)
+ answer = mallocstrcpy(answer, curranswer);
#ifndef NANO_TINY
redo_theprompt: