mirror of
https://codeberg.org/anoncontributorxmr/monero.git
synced 2024-11-26 09:24:47 +00:00
Merge pull request #7098
c0c75ac19
Fixed issues found by static analysis (SChernykh)
This commit is contained in:
commit
b9e444da5e
3 changed files with 5 additions and 6 deletions
|
@ -141,7 +141,6 @@ public:
|
||||||
|
|
||||||
rolling_median_t(rolling_median_t &&m)
|
rolling_median_t(rolling_median_t &&m)
|
||||||
{
|
{
|
||||||
free(data);
|
|
||||||
memcpy(this, &m, sizeof(rolling_median_t));
|
memcpy(this, &m, sizeof(rolling_median_t));
|
||||||
m.data = NULL;
|
m.data = NULL;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2834,8 +2834,8 @@ namespace nodetool
|
||||||
const uint32_t index = stripe - 1;
|
const uint32_t index = stripe - 1;
|
||||||
CRITICAL_REGION_LOCAL(m_used_stripe_peers_mutex);
|
CRITICAL_REGION_LOCAL(m_used_stripe_peers_mutex);
|
||||||
MINFO("adding stripe " << stripe << " peer: " << context.m_remote_address.str());
|
MINFO("adding stripe " << stripe << " peer: " << context.m_remote_address.str());
|
||||||
std::remove_if(m_used_stripe_peers[index].begin(), m_used_stripe_peers[index].end(),
|
m_used_stripe_peers[index].erase(std::remove_if(m_used_stripe_peers[index].begin(), m_used_stripe_peers[index].end(),
|
||||||
[&context](const epee::net_utils::network_address &na){ return context.m_remote_address == na; });
|
[&context](const epee::net_utils::network_address &na){ return context.m_remote_address == na; }), m_used_stripe_peers[index].end());
|
||||||
m_used_stripe_peers[index].push_back(context.m_remote_address);
|
m_used_stripe_peers[index].push_back(context.m_remote_address);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2848,8 +2848,8 @@ namespace nodetool
|
||||||
const uint32_t index = stripe - 1;
|
const uint32_t index = stripe - 1;
|
||||||
CRITICAL_REGION_LOCAL(m_used_stripe_peers_mutex);
|
CRITICAL_REGION_LOCAL(m_used_stripe_peers_mutex);
|
||||||
MINFO("removing stripe " << stripe << " peer: " << context.m_remote_address.str());
|
MINFO("removing stripe " << stripe << " peer: " << context.m_remote_address.str());
|
||||||
std::remove_if(m_used_stripe_peers[index].begin(), m_used_stripe_peers[index].end(),
|
m_used_stripe_peers[index].erase(std::remove_if(m_used_stripe_peers[index].begin(), m_used_stripe_peers[index].end(),
|
||||||
[&context](const epee::net_utils::network_address &na){ return context.m_remote_address == na; });
|
[&context](const epee::net_utils::network_address &na){ return context.m_remote_address == na; }), m_used_stripe_peers[index].end());
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class t_payload_net_handler>
|
template<class t_payload_net_handler>
|
||||||
|
|
|
@ -826,7 +826,7 @@ bool bulletproof_VERIFY(const std::vector<const Bulletproof*> &proofs)
|
||||||
proof_data.reserve(proofs.size());
|
proof_data.reserve(proofs.size());
|
||||||
size_t inv_offset = 0;
|
size_t inv_offset = 0;
|
||||||
std::vector<rct::key> to_invert;
|
std::vector<rct::key> to_invert;
|
||||||
to_invert.reserve(11 * sizeof(proofs));
|
to_invert.reserve(11 * proofs.size());
|
||||||
size_t max_logM = 0;
|
size_t max_logM = 0;
|
||||||
for (const Bulletproof *p: proofs)
|
for (const Bulletproof *p: proofs)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue