From 2bafcc32ca6c3fb02a28333aefb6bcdbde1d4768 Mon Sep 17 00:00:00 2001 From: git-hulk Date: Sat, 12 Feb 2022 17:43:36 +0800 Subject: [PATCH] Fix the connection fd was used after free --- src/redis_connection.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/redis_connection.cc b/src/redis_connection.cc index 57fd42e2eea..6271155c6fb 100644 --- a/src/redis_connection.cc +++ b/src/redis_connection.cc @@ -46,8 +46,8 @@ std::string Connection::ToString() { } void Connection::Close() { - owner_->FreeConnection(this); if (close_cb_) close_cb_(GetFD()); + owner_->FreeConnection(this); } void Connection::Detach() {