Added proper deallocation of history buffer
authorClifford Wolf <clifford@clifford.at>
Tue, 6 Aug 2013 13:03:46 +0000 (15:03 +0200)
committerClifford Wolf <clifford@clifford.at>
Tue, 6 Aug 2013 13:03:46 +0000 (15:03 +0200)
kernel/driver.cc

index 0bb12f94ddc4eb45092613dd7bed97c6c8bef9aa..8765c8b871233e81da34820a551c3fd2ed09b032 100644 (file)
@@ -617,6 +617,11 @@ int main(int argc, char **argv)
                        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)
                if (f != stderr)
                        fclose(f);