summaryrefslogtreecommitdiff
path: root/res/res_pjsip_endpoint_identifier_ip.c
diff options
context:
space:
mode:
Diffstat (limited to 'res/res_pjsip_endpoint_identifier_ip.c')
-rw-r--r--res/res_pjsip_endpoint_identifier_ip.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/res/res_pjsip_endpoint_identifier_ip.c b/res/res_pjsip_endpoint_identifier_ip.c
index 68922315e..6fc724a1e 100644
--- a/res/res_pjsip_endpoint_identifier_ip.c
+++ b/res/res_pjsip_endpoint_identifier_ip.c
@@ -247,7 +247,7 @@ static int ip_identify_match_handler(const struct aco_option *opt, struct ast_va
while ((current_string = ast_strip(strsep(&input_string, ",")))) {
char *mask = strrchr(current_string, '/');
- int error;
+ int error = 0;
if (ast_strlen_zero(current_string)) {
continue;
@@ -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;