address use after free error

This commit is contained in:
Mark Andrews
2015-08-16 20:28:52 +10:00
parent 95273fcb70
commit 6458ad3ab2

View File

@@ -616,7 +616,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 = ISC_R_SUCCESS;
@@ -649,6 +649,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,
@@ -656,7 +657,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);