From f3a9d2e0cd9fd0086a470752b6be8b9ce30e8e1a Mon Sep 17 00:00:00 2001 From: Malavan Sotheeswaran Date: Mon, 6 Feb 2023 20:33:21 -0800 Subject: [PATCH] technically possible for child_type == CHILD_TYPE_AOF without active child --- src/aof.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/aof.cpp b/src/aof.cpp index 94229169b..0044c02ed 100644 --- a/src/aof.cpp +++ b/src/aof.cpp @@ -752,7 +752,7 @@ void feedAppendOnlyFile(struct redisCommand *cmd, int dictid, robj **argv, int a * accumulate the differences between the child DB and the current one * in a buffer, so that when the child process will do its work we * can append the differences to the new append only file. */ - if (g_pserver->child_type == CHILD_TYPE_AOF) + if (hasActiveChildProcess() && g_pserver->child_type == CHILD_TYPE_AOF) aofRewriteBufferAppend((unsigned char*)buf,sdslen(buf)); sdsfree(buf);