]> 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:40:43 +0000 (17:10 +0530)
Patch contributed by yhu2 <yadi.hu@windriver.com>.

(cherry picked from commit a338c2d94781f676283f1b110f7802c71e2015bd)

CHANGES
lib/dns/view.c

diff --git a/CHANGES b/CHANGES
index 4c4d08555a0b933d8d437a8f0087e2374e0db10d..dd4a5d2db734d9567e3d5ac1cc3bcf5dc941ff24 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 4bfe203ccbddf43c1192b98debc4d18a908b01b2..e0d5864967cc977f0c6bf647bed3d031b59232f4 100644 (file)
@@ -603,6 +603,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;
@@ -610,8 +612,6 @@ resolver_shutdown(isc_task_t *task, isc_event_t *event) {
 
        UNLOCK(&view->lock);
 
-       isc_event_free(&event);
-
        if (done)
                destroy(view);
 }
@@ -627,6 +627,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;
@@ -634,8 +636,6 @@ adb_shutdown(isc_task_t *task, isc_event_t *event) {
 
        UNLOCK(&view->lock);
 
-       isc_event_free(&event);
-
        if (done)
                destroy(view);
 }
@@ -651,6 +651,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;
@@ -658,8 +660,6 @@ req_shutdown(isc_task_t *task, isc_event_t *event) {
 
        UNLOCK(&view->lock);
 
-       isc_event_free(&event);
-
        if (done)
                destroy(view);
 }