diff options
author | Andrew Waterman <andrew@sifive.com> | 2021-09-17 19:41:07 -0700 |
---|---|---|
committer | Andrew Waterman <andrew@sifive.com> | 2021-09-17 19:41:07 -0700 |
commit | 2a5181d913d9ea93e931752f2acf78689c8e0046 (patch) | |
tree | 85795c8cb5b67b88e4f59d5b62e4b1e609bc0260 /riscv/interactive.cc | |
parent | 3c3c0eaa861f177ece2b5a5756043c6c7b862a47 (diff) | |
download | spike-2a5181d913d9ea93e931752f2acf78689c8e0046.zip spike-2a5181d913d9ea93e931752f2acf78689c8e0046.tar.gz spike-2a5181d913d9ea93e931752f2acf78689c8e0046.tar.bz2 |
Fix memory leak
Diffstat (limited to 'riscv/interactive.cc')
-rw-r--r-- | riscv/interactive.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/riscv/interactive.cc b/riscv/interactive.cc index e0ed045..d0f6b4e 100644 --- a/riscv/interactive.cc +++ b/riscv/interactive.cc @@ -70,7 +70,7 @@ std::string sim_t::rin(boost::asio::streambuf *bout_ptr) { std::string s; if (acceptor_ptr) { // if we are listening, get commands from socket try { - socket_ptr = new boost::asio::ip::tcp::socket(*io_service_ptr); + socket_ptr.reset(new boost::asio::ip::tcp::socket(*io_service_ptr)); acceptor_ptr->accept(*socket_ptr); // wait for someone to open connection boost::asio::streambuf buf; boost::asio::read_until(*socket_ptr, buf, "\n"); // wait for command |