Properly handle situation if no resolver plugins are loaded
This commit is contained in:
@@ -60,7 +60,7 @@ METHOD(plugin_t, destroy, void,
|
||||
{
|
||||
lib->credmgr->remove_set(lib->credmgr, &this->cred->set);
|
||||
}
|
||||
this->res->destroy(this->res);
|
||||
DESTROY_IF(this->res);
|
||||
DESTROY_IF(this->cred);
|
||||
free(this);
|
||||
}
|
||||
@@ -87,8 +87,7 @@ plugin_t *ipseckey_plugin_create()
|
||||
|
||||
if (!this->res)
|
||||
{
|
||||
DBG1(DBG_CFG, "ipseckey_plugin: Failed to create"
|
||||
"a DNS resolver instance");
|
||||
DBG1(DBG_CFG, "failed to create a DNS resolver instance");
|
||||
destroy(this);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -56,7 +56,11 @@ METHOD(resolver_manager_t, remove_resolver, void,
|
||||
METHOD(resolver_manager_t, create, resolver_t*,
|
||||
private_resolver_manager_t *this)
|
||||
{
|
||||
return this->constructor();
|
||||
if (this->constructor)
|
||||
{
|
||||
return this->constructor();
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
METHOD(resolver_manager_t, destroy, void,
|
||||
|
||||
Reference in New Issue
Block a user