]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Fix a shutdown bug in update_rpz_cb()
authorAram Sargsyan <aram@isc.org>
Tue, 3 Jan 2023 13:21:34 +0000 (13:21 +0000)
committerAram Sargsyan <aram@isc.org>
Tue, 14 Feb 2023 10:26:37 +0000 (10:26 +0000)
When shutting down, the cleanup path should not try to destroy
'newnodes', because it is NULL at that point.

Introduce another label for the "shuttingdown" scenario.

(cherry picked from commit 975d16230b5831532ec66769b60657c86882a244)

lib/dns/rpz.c

index 4cacb4f8aa43371471460e4be6b469d4a807efdc..eb19c4d7afe3cb3d1683183f2c12ea51551f63f7 100644 (file)
@@ -1918,7 +1918,7 @@ update_rpz_cb(void *data) {
 
        result = dns__rpz_shuttingdown(rpz->rpzs);
        if (result != ISC_R_SUCCESS) {
-               goto cleanup;
+               goto shuttingdown;
        }
 
        isc_ht_init(&newnodes, rpz->rpzs->mctx, 1, ISC_HT_CASE_SENSITIVE);
@@ -1939,6 +1939,7 @@ update_rpz_cb(void *data) {
 cleanup:
        isc_ht_destroy(&newnodes);
 
+shuttingdown:
        rpz->updateresult = result;
 }