Skip to content

Commit

Permalink
Mandatory piggyback: avoid polution on free_pools_ collection
Browse files Browse the repository at this point in the history
Signed-off-by: Miguel Barro <miguelbarro@eprosima.com>
  • Loading branch information
Miguel Barro committed Sep 29, 2022
1 parent 14b7c14 commit 97e3f18
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/cpp/rtps/history/TopicPayloadPool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,11 @@ void TopicPayloadPool::reserve (
for (size_t i = all_payloads_.size(); i < min_num_payloads; ++i)
{
PayloadNode* payload = do_allocate(size);
free_payloads_.push_back(payload);

if(payload != nullptr)
{
free_payloads_.push_back(payload);
}
}
}

Expand Down

0 comments on commit 97e3f18

Please sign in to comment.