summaryrefslogtreecommitdiff
path: root/res/res_pjsip/config_system.c
diff options
context:
space:
mode:
Diffstat (limited to 'res/res_pjsip/config_system.c')
-rw-r--r--res/res_pjsip/config_system.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/res/res_pjsip/config_system.c b/res/res_pjsip/config_system.c
index 8c4c548fa..f88b96b89 100644
--- a/res/res_pjsip/config_system.c
+++ b/res/res_pjsip/config_system.c
@@ -201,6 +201,7 @@ static int system_create_resolver_and_set_nameservers(void *data)
status = pjsip_endpt_create_resolver(ast_sip_get_pjsip_endpoint(), &resolver);
if (status != PJ_SUCCESS) {
ast_log(LOG_ERROR, "Could not create DNS resolver(%d), resorting to system resolution\n", status);
+ ao2_ref(discovered_nameservers, -1);
return 0;
}
}
@@ -241,4 +242,4 @@ static int system_create_resolver_and_set_nameservers(void *data)
void ast_sip_initialize_dns(void)
{
ast_sip_push_task_synchronous(NULL, system_create_resolver_and_set_nameservers, NULL);
-} \ No newline at end of file
+}