2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 14:07:59 +00:00

Merge branch '556-race-condition-in-timer-creation' into 'master'

Fix crash caused by race condition in timer creation

Closes #556

See merge request isc-projects/bind9!801
This commit is contained in:
Evan Hunt
2018-09-27 15:59:30 -04:00

View File

@@ -398,8 +398,10 @@ isc__timer_create(isc_timermgr_t *manager0, isc_timertype_t type,
result = schedule(timer, &now, true);
else
result = ISC_R_SUCCESS;
if (result == ISC_R_SUCCESS)
if (result == ISC_R_SUCCESS) {
*timerp = (isc_timer_t *)timer;
APPEND(manager->timers, timer, link);
}
UNLOCK(&manager->lock);
@@ -412,8 +414,6 @@ isc__timer_create(isc_timermgr_t *manager0, isc_timertype_t type,
return (result);
}
*timerp = (isc_timer_t *)timer;
return (ISC_R_SUCCESS);
}