diff --git a/bftengine/src/bftengine/ReplicaLoader.cpp b/bftengine/src/bftengine/ReplicaLoader.cpp index 8389392955..56a65aa905 100644 --- a/bftengine/src/bftengine/ReplicaLoader.cpp +++ b/bftengine/src/bftengine/ReplicaLoader.cpp @@ -175,6 +175,9 @@ ReplicaLoader::ErrorCode loadViewInfo(shared_ptr &p, LoadedRe descriptorOfLastNewView.viewChangeMsgs); ld.maxSeqNumTransferredFromPrevViews = descriptorOfLastNewView.maxSeqNumTransferredFromPrevViews; + // we have not used descriptorOfLastExitFromView, therefore + // we need to clean up the messages we have allocated inside it. + descriptorOfLastExitFromView.clean(); } else { LOG_ERROR(GL, "Failed to load view (inconsistent state): " << KVLOG( @@ -183,7 +186,6 @@ ReplicaLoader::ErrorCode loadViewInfo(shared_ptr &p, LoadedRe } ld.viewsManager = viewsManager; - descriptorOfLastExitFromView.clean(); return Succ; }