diff options
author | Joshua Colp <jcolp@digium.com> | 2014-03-18 12:45:49 +0000 |
---|---|---|
committer | Joshua Colp <jcolp@digium.com> | 2014-03-18 12:45:49 +0000 |
commit | 216b04e6f40f72fe682e1ed3cf8c38ec3c9514a8 (patch) | |
tree | ee7d4ea57c96012770d896bffd65e2faa7565419 /res/res_pjsip/config_system.c | |
parent | 83570270803ff5d82c700f0a5c887297a57b4a86 (diff) |
res_pjsip: Fix memory leak of nameservers in off-nominal resolver creation failure.
Thanks Walter Doekes!
........
Merged revisions 410844 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@410845 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/res_pjsip/config_system.c')
-rw-r--r-- | res/res_pjsip/config_system.c | 3 |
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 +} |