Skip to content

Commit

Permalink
Cp braft #458 (#16)
Browse files Browse the repository at this point in the history
fix mem leak in Replicator::_prepare_entry
details: baidu/braft#458

Co-authored-by: walterzhaoJR <[email protected]>
Co-authored-by: doc001 <[email protected]>
  • Loading branch information
3 people committed Jun 25, 2024
1 parent ddb2be6 commit 6e6941a
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 @@ -624,6 +624,7 @@ int Replicator::_prepare_entry(int offset, EntryMeta* em, butil::IOBuf* data) {
// waiting new logs 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 6e6941a

Please sign in to comment.