Skip to content

Commit 2cb7271

Browse files
committed
Reviewer requested change
1 parent 1ea9e13 commit 2cb7271

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/icp_v2.cc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -739,8 +739,10 @@ icpIncomingConnectionOpened(Ipc::StartListeningAnswer &answer)
739739

740740
Comm::SetSelect(conn->fd, COMM_SELECT_READ, icpHandleUdp, nullptr, 0);
741741

742-
for (auto &s : Config.mcast_group_list)
743-
ipcache_nbgethostbyname(s.c_str(), mcastJoinGroups, nullptr); // XXX: pass the conn for mcastJoinGroups usage.
742+
for (const auto &groupName : Config.mcast_group_list) {
743+
SBuf tmp(groupName); // XXX: c_str() may reallocate
744+
ipcache_nbgethostbyname(tmp.c_str(), mcastJoinGroups, nullptr); // XXX: pass the conn for mcastJoinGroups usage.
745+
}
744746

745747
debugs(12, DBG_IMPORTANT, "Accepting ICP messages on " << conn->local);
746748

0 commit comments

Comments
 (0)