diff --git a/bin/named/unix/dlz_dlopen_driver.c b/bin/named/unix/dlz_dlopen_driver.c index df11984970..e88ea6fc52 100644 --- a/bin/named/unix/dlz_dlopen_driver.c +++ b/bin/named/unix/dlz_dlopen_driver.c @@ -339,7 +339,7 @@ dlopen_dlz_destroy(void *driverarg, void *dbdata) { UNUSED(driverarg); - if (cd->dlz_destroy) { + if (cd->dlz_destroy && cd->dbdata) { MAYBE_LOCK(cd); cd->dlz_destroy(cd->dbdata); MAYBE_UNLOCK(cd);