Fix minor fd leak in rdbSaveToSlavesSockets (#12919)

We should close server.rdb_child_exit_pipe when redisFork fails,
otherwise the pipe fd will be leaked.

Just a cleanup.
This commit is contained in:
Binbin 2024-01-08 23:36:34 +08:00 committed by GitHub
parent 50b8b99763
commit 14e4a9835a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -3636,6 +3636,7 @@ int rdbSaveToSlavesSockets(int req, rdbSaveInfo *rsi) {
}
close(rdb_pipe_write);
close(server.rdb_pipe_read);
close(server.rdb_child_exit_pipe);
zfree(server.rdb_pipe_conns);
server.rdb_pipe_conns = NULL;
server.rdb_pipe_numconns = 0;