tgockel / zookeeper-cpp

A ZooKeeper client for C++.
http://tgockel.github.io/zookeeper-cpp/
Apache License 2.0
148 stars 40 forks source link

core: Fix potential segfault in `connection_zk` async operations. #99

Closed tgockel closed 6 years ago

tgockel commented 6 years ago

If an async operation completes a server round trip before the caller gets to the next line (a rare circumstance), the promise meant to deliver the operation will be freed before get_future is called, leading to a potential segfault. This change calls get_future before sending the operation to the ZooKeeper C library.