Commit c4ed2be3 authored by Dominik Charousset's avatar Dominik Charousset

Fix heap-use-after-free in merge operator

parent c7edd72b
...@@ -130,10 +130,12 @@ public: ...@@ -130,10 +130,12 @@ public:
void fwd_on_next(input_key key, const observable<T>& item) { void fwd_on_next(input_key key, const observable<T>& item) {
CAF_LOG_TRACE(CAF_ARG(key) << CAF_ARG(item)); CAF_LOG_TRACE(CAF_ARG(key) << CAF_ARG(item));
if (auto ptr = get(key)) { if (auto ptr = get(key))
subscribe_to(item); subscribe_to(item);
// Note: we need to double-check that the key still exists here, because
// subscribe_on may result in an error (that nukes all inputs).
if (auto ptr = get(key))
ptr->sub.request(1); ptr->sub.request(1);
}
} }
// -- implementation of subscription_impl ------------------------------------ // -- implementation of subscription_impl ------------------------------------
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment