mirror of
https://github.com/SChernykh/p2pool.git
synced 2025-01-05 18:29:23 +00:00
JSON RPC: fixed memory leak after an error
This commit is contained in:
parent
f3e96d7138
commit
bf1a09097f
2 changed files with 5 additions and 1 deletions
|
@ -495,6 +495,8 @@ void Call(const std::string& address, int port, const std::string& req, const st
|
|||
catch (const std::exception& e) {
|
||||
const char* msg = e.what();
|
||||
(*close_cb)(msg, strlen(msg), 0.0);
|
||||
delete cb;
|
||||
delete close_cb;
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -502,6 +504,8 @@ void Call(const std::string& address, int port, const std::string& req, const st
|
|||
static constexpr char err[] = "CallOnLoop failed";
|
||||
LOGERR(1, err);
|
||||
(*close_cb)(err, sizeof(err) - 1, 0.0);
|
||||
delete cb;
|
||||
delete close_cb;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -658,7 +658,7 @@ void p2pool::submit_aux_block_async(const std::vector<SubmitAuxBlockData>& aux_b
|
|||
|
||||
// If p2pool is stopped, m_submitAuxBlockAsync is most likely already closed
|
||||
if (m_stopped) {
|
||||
LOGWARN(0, "p2pool is shutting down, but a block was found. Trying to submit it anyway!");
|
||||
LOGWARN(0, "p2pool is shutting down, but an aux block was found. Trying to submit it anyway!");
|
||||
submit_aux_block();
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue