Added proper deallocation of history buffer

This commit is contained in:
Clifford Wolf 2013-08-06 15:03:46 +02:00
parent 8b2f7792ba
commit ff965424c2
1 changed files with 5 additions and 0 deletions

View File

@ -617,6 +617,11 @@ int main(int argc, char **argv)
write_history(history_file.c_str()); write_history(history_file.c_str());
} }
clear_history();
HIST_ENTRY **hist_list = history_list();
if (hist_list != NULL)
free(hist_list);
for (auto f : log_files) for (auto f : log_files)
if (f != stderr) if (f != stderr)
fclose(f); fclose(f);