]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
[36720] Free event early (fixes race to free)
authorMukund Sivaraman <muks@isc.org>
Tue, 5 Aug 2014 11:28:23 +0000 (16:58 +0530)
committerMukund Sivaraman <muks@isc.org>
Tue, 5 Aug 2014 11:38:14 +0000 (17:08 +0530)
Patch contributed by yhu2 <yadi.hu@windriver.com>.

CHANGES
lib/dns/view.c

diff --git a/CHANGES b/CHANGES
index 480ce6b1ac57af19e6c111be542036d2840283e7..4b68841dfc7b636b6a0dee157d9e1089231d5b69 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,5 @@
+3910.  [bug]           Fix races to free event during shutdown. [RT#36720]
+
 3909.  [bug]           When computing the number of elements required for a
                        acl count_acl_elements could have a short count leading
                        to a assertion failure.  Also zero out new acl elements
index fe43e94ef59c62f4bee1294901a0578ecacb251f..d16e3bd62bf5a3bdf5b828892f0340c50534d1aa 100644 (file)
@@ -627,6 +627,8 @@ resolver_shutdown(isc_task_t *task, isc_event_t *event) {
 
        UNUSED(task);
 
+       isc_event_free(&event);
+
        LOCK(&view->lock);
 
        view->attributes |= DNS_VIEWATTR_RESSHUTDOWN;
@@ -634,8 +636,6 @@ resolver_shutdown(isc_task_t *task, isc_event_t *event) {
 
        UNLOCK(&view->lock);
 
-       isc_event_free(&event);
-
        if (done)
                destroy(view);
 }
@@ -651,6 +651,8 @@ adb_shutdown(isc_task_t *task, isc_event_t *event) {
 
        UNUSED(task);
 
+       isc_event_free(&event);
+
        LOCK(&view->lock);
 
        view->attributes |= DNS_VIEWATTR_ADBSHUTDOWN;
@@ -658,8 +660,6 @@ adb_shutdown(isc_task_t *task, isc_event_t *event) {
 
        UNLOCK(&view->lock);
 
-       isc_event_free(&event);
-
        if (done)
                destroy(view);
 }
@@ -675,6 +675,8 @@ req_shutdown(isc_task_t *task, isc_event_t *event) {
 
        UNUSED(task);
 
+       isc_event_free(&event);
+
        LOCK(&view->lock);
 
        view->attributes |= DNS_VIEWATTR_REQSHUTDOWN;
@@ -682,8 +684,6 @@ req_shutdown(isc_task_t *task, isc_event_t *event) {
 
        UNLOCK(&view->lock);
 
-       isc_event_free(&event);
-
        if (done)
                destroy(view);
 }