diff options
author | Joshua Colp <jcolp@digium.com> | 2017-01-26 13:57:59 +0000 |
---|---|---|
committer | Joshua Colp <jcolp@digium.com> | 2017-01-26 10:59:10 -0600 |
commit | 7fa3de7ae9146f5267f45feb9fbf1c523bcaf7d4 (patch) | |
tree | 2e67c3476116db0aa351452d8638fa7f5aa29741 /res/res_pjsip_endpoint_identifier_ip.c | |
parent | 96dbf54e971952bb99b6e80ddf8929340bd107d4 (diff) |
res_pjsip_endpoint_identifier_ip: Fix memory leak of hosts when resolving.
This change adds a missing unreference of the hostname when resolving and
also cleans up the iterator.
ASTERISK-26735
Change-Id: Ic012ebaf3d89e714eec340b7b0c5e63c66af857a
Diffstat (limited to 'res/res_pjsip_endpoint_identifier_ip.c')
-rw-r--r-- | res/res_pjsip_endpoint_identifier_ip.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/res/res_pjsip_endpoint_identifier_ip.c b/res/res_pjsip_endpoint_identifier_ip.c index 116e2d8d7..86a5afbdb 100644 --- a/res/res_pjsip_endpoint_identifier_ip.c +++ b/res/res_pjsip_endpoint_identifier_ip.c @@ -323,9 +323,14 @@ static int ip_identify_apply(const struct ast_sorcery *sorcery, void *obj) } else if (results == -1) { ast_log(LOG_ERROR, "An error occurred when adding resolution results of '%s' on '%s'\n", current_string, ast_sorcery_object_get_id(obj)); + ao2_ref(current_string, -1); + ao2_iterator_destroy(&i); return -1; } + + ao2_ref(current_string, -1); } + ao2_iterator_destroy(&i); ao2_ref(identify->hosts, -1); identify->hosts = NULL; |