Fix a shutdown bug in update_rpz_cb()

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 975d16230b)
This commit is contained in:
Aram Sargsyan 2023-01-03 13:21:34 +00:00
parent c8206cab0b
commit cc4cb67149

View 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;
}