]> 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, 3 Jan 2023 13:27:43 +0000 (13:27 +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.

lib/dns/rpz.c

index efe04b79e32426af24a7623f17d64e46bffa0b80..bb9a7ba8514d1e2af12b2fc4bd0c40a8a5c62706 100644 (file)
@@ -1911,7 +1911,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);
@@ -1932,6 +1932,7 @@ update_rpz_cb(void *data) {
 cleanup:
        isc_ht_destroy(&newnodes);
 
+shuttingdown:
        rpz->updateresult = result;
 }