From c5a306817f3976f64da9a0a9d5112164392e028d Mon Sep 17 00:00:00 2001 From: walterzhaoJR <519362600@qq.com> Date: Fri, 21 Jun 2024 18:11:53 +0800 Subject: [PATCH] fix mem leak in Replicator::_prepare_entry detail:https://github.com/baidu/braft/issues/454 --- src/braft/replicator.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/braft/replicator.cpp b/src/braft/replicator.cpp index f2e2bb5c..cb3b75ec 100644 --- a/src/braft/replicator.cpp +++ b/src/braft/replicator.cpp @@ -610,6 +610,7 @@ int Replicator::_prepare_entry(int offset, EntryMeta* em, butil::IOBuf *data) { // until the replicator leave readonly mode. if (_readonly_index != 0 && log_index >= _readonly_index) { if (entry->type != ENTRY_TYPE_CONFIGURATION) { + entry->Release(); return EREADONLY; } _readonly_index = log_index + 1;