Skip to content

Commit

Permalink
Fix premature memory free in cp_node.cc
Browse files Browse the repository at this point in the history
  • Loading branch information
johnousterhout committed Nov 3, 2022
1 parent d1048e8 commit a205041
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion util/cp_node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,6 @@ void init_server_addrs(void)
}
dest = reinterpret_cast<sockaddr_in_union *>
(matching_addresses->ai_addr);
freeaddrinfo(matching_addresses);
while (((int) first_id.size()) < node)
first_id.push_back(-1);
first_id.push_back((int) server_addrs.size());
Expand All @@ -510,6 +509,7 @@ void init_server_addrs(void)
}
while (((int) freeze.size()) <= node)
freeze.push_back(0);
freeaddrinfo(matching_addresses);
}
}

Expand Down

0 comments on commit a205041

Please sign in to comment.