]> 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:39:12 +0000 (17:09 +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 29c5a08b46cf0b7f55c9923d319d7a992db6b750..457a29c4c7dc9137f63948b7b0501cd067b6e211 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 c5eff7879d50812bdf8c87421e28c76308d1362f..5569c8db19e10b9b072746f8912b7e9c5790d150 100644 (file)
@@ -621,6 +621,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;
@@ -628,8 +630,6 @@ resolver_shutdown(isc_task_t *task, isc_event_t *event) {
 
        UNLOCK(&view->lock);
 
-       isc_event_free(&event);
-
        if (done)
                destroy(view);
 }
@@ -645,6 +645,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;
@@ -652,8 +654,6 @@ adb_shutdown(isc_task_t *task, isc_event_t *event) {
 
        UNLOCK(&view->lock);
 
-       isc_event_free(&event);
-
        if (done)
                destroy(view);
 }
@@ -669,6 +669,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;
@@ -676,8 +678,6 @@ req_shutdown(isc_task_t *task, isc_event_t *event) {
 
        UNLOCK(&view->lock);
 
-       isc_event_free(&event);
-
        if (done)
                destroy(view);
 }