diff options
author | Martin Nagy <mnagy@redhat.com> | 2009-04-22 15:54:09 +0200 |
---|---|---|
committer | Martin Nagy <mnagy@redhat.com> | 2009-04-22 16:12:17 +0200 |
commit | 86d9a8a83aa6e8c43fb2cd6d4755332ab64f0967 (patch) | |
tree | bba6a0589d1df2012980bc47f1bb5404765690ee | |
parent | 15cf31b135b39a659a634f59b1bc4ed52cc2ca4f (diff) | |
download | ldap_driver_testing-86d9a8a83aa6e8c43fb2cd6d4755332ab64f0967.tar.gz ldap_driver_testing-86d9a8a83aa6e8c43fb2cd6d4755332ab64f0967.tar.xz ldap_driver_testing-86d9a8a83aa6e8c43fb2cd6d4755332ab64f0967.zip |
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.
-rw-r--r-- | src/ldap_driver.c | 5 |
1 files changed, 4 insertions, 1 deletions
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(); } |