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

This fixes https://savannah.gnu.org/bugs/?53157.
master
Benno Schulenberg 2018-02-14 18:18:46 +01:00
parent 0cf455bc48
commit 5b870a7632
1 changed files with 1 additions and 1 deletions

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