From 86d9a8a83aa6e8c43fb2cd6d4755332ab64f0967 Mon Sep 17 00:00:00 2001 From: Martin Nagy Date: Wed, 22 Apr 2009 15:54:09 +0200 Subject: Forgotten NULL check. Only unregister the implementation if it was registered by us. This prevents errors if we are using the same DB implementation multiple times. --- src/ldap_driver.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/ldap_driver.c') diff --git a/src/ldap_driver.c b/src/ldap_driver.c index 86b9560..5b01604 100644 --- a/src/ldap_driver.c +++ b/src/ldap_driver.c @@ -1064,6 +1064,7 @@ dynamic_driver_init(isc_mem_t *mctx, const char *name, const char * const *argv, } /* Register new DNS DB implementation. */ + ldapdb_imp = NULL; result = dns_db_register(ldapdb_impname, &ldapdb_create, NULL, mctx, &ldapdb_imp); if (result != ISC_R_SUCCESS && result != ISC_R_EXISTS) @@ -1109,6 +1110,8 @@ cleanup: void dynamic_driver_destroy(void) { - dns_db_unregister(&ldapdb_imp); + /* Only unregister the implementation if it was registered by us. */ + if (ldapdb_imp != NULL) + dns_db_unregister(&ldapdb_imp); destroy_manager(); } -- cgit