From 14e4a9835af2bb7df8c42cfb850bd19708cd73d0 Mon Sep 17 00:00:00 2001 From: Binbin Date: Mon, 8 Jan 2024 23:36:34 +0800 Subject: [PATCH] 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. --- src/rdb.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/rdb.c b/src/rdb.c index f6b0054cc..ac88c7be0 100644 --- a/src/rdb.c +++ b/src/rdb.c @@ -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;