diff --git a/src/rpc/cli.cpp b/src/rpc/cli.cpp index 2570c9f..29d5051 100644 --- a/src/rpc/cli.cpp +++ b/src/rpc/cli.cpp @@ -217,18 +217,16 @@ void cli::getline( const fc::string& prompt, fc::string& line) if( line_read == nullptr ) FC_THROW_EXCEPTION( fc::eof_exception, "" ); line = line_read; - if (*line_read) + try { - try - { + if (*line_read) add_history(line_read); - free(line_read); - } - catch(...) - { - free(line_read); - throw; - } + free(line_read); + } + catch(...) + { + free(line_read); + throw; } }).wait(); }