Skip to content

Commit

Permalink
Merge pull request #458 from walterzhaoJR/fix-mem-leak-issues-454
Browse files Browse the repository at this point in the history
fix mem leak in Replicator::_prepare_entry
  • Loading branch information
PFZheng committed Jun 21, 2024
2 parents b37c610 + c5a3068 commit bc9fb05
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/braft/replicator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit bc9fb05

Please sign in to comment.