Browse Source

Backed out changeset 68c2124f583a

This leads to double free because of unordered_map
ENGINE-781
Volker Birk 2 years ago
parent
commit
b6586e520f
2 changed files with 4 additions and 12 deletions
  1. +2
    -10
      message_cache.cc
  2. +2
    -2
      message_cache.hh

+ 2
- 10
message_cache.cc View File

@ -16,16 +16,6 @@ namespace pEp {
next_id = u(e);
}
MessageCache::cache_entry::cache_entry(::message *s, ::message *d)
: src(s), dst(d)
{ }
MessageCache::cache_entry::~cache_entry()
{
::free_message(src);
::free_message(dst);
}
PEP_STATUS MessageCache::cache_decrypt_message(
PEP_SESSION session,
message *src,
@ -360,6 +350,8 @@ namespace pEp {
{
std::lock_guard<std::mutex> l(_mtx);
::free_message(_cache.at(msg->id).src);
::free_message(_cache.at(msg->id).dst);
_cache.erase(msg->id);
}


+ 2
- 2
message_cache.hh View File

@ -9,8 +9,8 @@
namespace pEp {
class MessageCache {
struct cache_entry {
cache_entry(::message *s, ::message *d);
~cache_entry();
cache_entry(::message *s, ::message *d)
: src(s), dst(d) { }
::message *src;
::message *dst;


Loading…
Cancel
Save