goto: avoid a segfault, by initializing 'answer' when it is NULL

This fixes https://savannah.gnu.org/bugs/?53157.
This commit is contained in:
Benno Schulenberg 2018-02-14 18:18:46 +01:00
parent 0cf455bc48
commit 5b870a7632

View File

@ -617,7 +617,7 @@ int do_prompt(bool allow_tabs, bool allow_files,
bottombars(menu);
if (answer != curranswer)
if (answer != curranswer || answer == NULL)
answer = mallocstrcpy(answer, curranswer);
#ifndef NANO_TINY