summaryrefslogtreecommitdiff
path: root/res/res_pjsip_config_wizard.c
diff options
context:
space:
mode:
authorBadalyan Vyacheslav <v.badalyan@open-bs.ru>2016-10-10 11:59:38 -0400
committerBadalyan Vyacheslav <v.badalyan@open-bs.ru>2016-10-10 12:01:20 -0400
commit3ab7fae96b610a69c0a4f7fa639c658810858e63 (patch)
tree1fab5a199c87c3af41236716b87f87d9b8a3494b /res/res_pjsip_config_wizard.c
parent7126194187f1ddae1a6e7a7f80f5e84bafd6db4b (diff)
res_pjsip_config_wizard: Memory leak in module_unload
Fixed a memory leak. It removes only the first element. Added a useful feature in vector.h to remove all items under the CMP through a callback function / macro. ASTERISK-26453 #close Change-Id: I84508353463456d2495678f125738e20052da950
Diffstat (limited to 'res/res_pjsip_config_wizard.c')
-rw-r--r--res/res_pjsip_config_wizard.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/res/res_pjsip_config_wizard.c b/res/res_pjsip_config_wizard.c
index cf09a5415..aec923dfa 100644
--- a/res/res_pjsip_config_wizard.c
+++ b/res/res_pjsip_config_wizard.c
@@ -989,7 +989,7 @@ static int wizard_apply_handler(const struct ast_sorcery *sorcery, struct object
rc = handle_registrations(sorcery, otw, wiz, &remote_hosts_vector);
}
- AST_VECTOR_REMOVE_CMP_UNORDERED(&remote_hosts_vector, NULL, NOT_EQUALS, ast_free);
+ AST_VECTOR_REMOVE_ALL_CMP_UNORDERED(&remote_hosts_vector, NULL, NOT_EQUALS, ast_free);
AST_VECTOR_FREE(&remote_hosts_vector);
ast_debug(4, "%s handler complete. rc: %d\n", otw->object_type, rc);
@@ -1293,7 +1293,7 @@ static int unload_module(void)
{
ast_cli_unregister_multiple(config_wizard_cli, ARRAY_LEN(config_wizard_cli));
ast_sorcery_global_observer_remove(&global_observer);
- AST_VECTOR_REMOVE_CMP_UNORDERED(&object_type_wizards, NULL, NOT_EQUALS, OTW_DELETE_CB);
+ AST_VECTOR_REMOVE_ALL_CMP_UNORDERED(&object_type_wizards, NULL, NOT_EQUALS, OTW_DELETE_CB);
AST_VECTOR_RW_FREE(&object_type_wizards);
return 0;