address use after free error

(cherry picked from commit 6458ad3ab2)
This commit is contained in:
Mark Andrews
2015-08-16 20:28:52 +10:00
parent 40130c37fc
commit 789cf538f9

View File

@@ -602,7 +602,7 @@ listener_copysock(ns_lwreslistener_t *oldlistener,
static isc_result_t
listener_startclients(ns_lwreslistener_t *listener) {
ns_lwdclientmgr_t *cm;
ns_lwdclientmgr_t *cm, *next;
unsigned int i;
isc_result_t result;
@@ -626,6 +626,7 @@ listener_startclients(ns_lwreslistener_t *listener) {
LOCK(&listener->lock);
cm = ISC_LIST_HEAD(listener->cmgrs);
while (cm != NULL) {
next = ISC_LIST_NEXT(cm, link);
result = ns_lwdclient_startrecv(cm);
if (result != ISC_R_SUCCESS)
isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL,
@@ -633,7 +634,7 @@ listener_startclients(ns_lwreslistener_t *listener) {
"could not start lwres "
"client handler: %s",
isc_result_totext(result));
cm = ISC_LIST_NEXT(cm, link);
cm = next;
}
UNLOCK(&listener->lock);