avoid double close on replica main channel (#1097)

fixes #1088

Signed-off-by: Ran Shidlansik <ranshid@amazon.com>
This commit is contained in:
ranshid 2024-09-30 17:41:05 +03:00 committed by GitHub
parent a7cbca4066
commit c873287d16
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2738,8 +2738,10 @@ static void fullSyncWithPrimary(connection *conn) {
error:
sdsfree(err);
connClose(conn);
server.repl_transfer_s = NULL;
if (server.repl_transfer_s) {
connClose(server.repl_transfer_s);
server.repl_transfer_s = NULL;
}
if (server.repl_rdb_transfer_s) {
connClose(server.repl_rdb_transfer_s);
server.repl_rdb_transfer_s = NULL;