Reviewers: kezhuw, ztzg Author: fanyang89 Closes #2138 from fanyang89/fix-c-client-hostname-uaf
@@ -2558,8 +2558,9 @@ int zookeeper_interest(zhandle_t *zh, socket_t *fd, int *interest,
*tv = get_timeval(zh->recv_timeout/60);
zh->delay = 0;
- LOG_WARN(LOGCALLBACK(zh), "Delaying connection after exhaustively trying all servers [%s]",
- zh->hostname);
+ lock_reconfig(zh);
+ LOG_WARN(LOGCALLBACK(zh), "Delaying connection after exhaustively trying all servers [%s]", zh->hostname);
+ unlock_reconfig(zh);
} else {
if (addr_rw_server) {
zh->addr_cur = *addr_rw_server;