diff --git a/contrib/epee/src/readline_buffer.cpp b/contrib/epee/src/readline_buffer.cpp index ac68d1fdb..76ac9c8b5 100644 --- a/contrib/epee/src/readline_buffer.cpp +++ b/contrib/epee/src/readline_buffer.cpp @@ -2,6 +2,7 @@ #include #include #include +#include #include #include #include @@ -201,7 +202,7 @@ static void handle_line(char* line) static bool same_as_last_line(const std::string& test_line) { // Note that state->offset == state->length, when a new line was entered. - HISTORY_STATE* state = history_get_history_state(); + auto state = std::unique_ptr{history_get_history_state(), free}; return state->length > 0 && test_line.compare(state->entries[state->length-1]->line) == 0; }