Skip to content

Commit

Permalink
fix(hyclone_server): NodeMonitorService segfault
Browse files Browse the repository at this point in the history
Fixed a mistake while porting Haiku source that causes a pointer
to be left `NULL` when calling
`NodeMonitorService::RemoveUserListeners`.
  • Loading branch information
trungnt2910 committed Apr 25, 2023
1 parent ce2a29c commit 87fec10
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions hyclone_server/server_nodemonitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ status_t NodeMonitorService::RemoveUserListeners(

for (auto it = context->GetMonitors().begin(); it != context->GetMonitors().end();)
{
const std::shared_ptr<monitor_listener>& removeListener = *it;
listener = *it;
auto nextIt = std::next(it);

if (*listener->listener != userListener)
Expand All @@ -513,7 +513,7 @@ status_t NodeMonitorService::RemoveUserListeners(
continue;
}

_RemoveListener(context, removeListener);
_RemoveListener(context, listener);
++count;

it = nextIt;
Expand Down

0 comments on commit 87fec10

Please sign in to comment.