diff --git a/dbms/src/Common/ZooKeeper/ZooKeeperImpl.cpp b/dbms/src/Common/ZooKeeper/ZooKeeperImpl.cpp index fa39f857a4a..8b80e74c96d 100644 --- a/dbms/src/Common/ZooKeeper/ZooKeeperImpl.cpp +++ b/dbms/src/Common/ZooKeeper/ZooKeeperImpl.cpp @@ -1021,6 +1021,10 @@ void ZooKeeper::receiveEvent() { tryLogCurrentException(__PRETTY_FUNCTION__); + /// Unrecoverable. Don't leave incorrect state in memory. + if (!response) + std::terminate(); + response->error = ZMARSHALLINGERROR; if (request_info.callback) request_info.callback(*response);