[Asterisk-code-review] res pjsip config wizard: Fix memory leak on unload (asterisk[14])

Badalian Vyacheslav asteriskteam at digium.com
Sun Oct 9 22:48:13 CDT 2016


Badalian Vyacheslav has uploaded a new change for review.

  https://gerrit.asterisk.org/4049

Change subject: res_pjsip_config_wizard: Fix memory leak on unload
......................................................................

res_pjsip_config_wizard: Fix memory leak on unload

Change-Id: I2823f77be83cf94a259ace7b30c31d50d9805d9b
---
M res/res_pjsip_config_wizard.c
1 file changed, 10 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/49/4049/1

diff --git a/res/res_pjsip_config_wizard.c b/res/res_pjsip_config_wizard.c
index cf09a54..267056e 100644
--- a/res/res_pjsip_config_wizard.c
+++ b/res/res_pjsip_config_wizard.c
@@ -1293,6 +1293,16 @@
 {
 	ast_cli_unregister_multiple(config_wizard_cli, ARRAY_LEN(config_wizard_cli));
 	ast_sorcery_global_observer_remove(&global_observer);
+
+	AST_VECTOR_RW_RDLOCK(&object_type_wizards);
+	for(int idx = 0; idx < AST_VECTOR_SIZE(&object_type_wizards); ++idx) {
+		struct object_type_wizard *otw = AST_VECTOR_GET(&object_type_wizards, idx);
+		if (otw){
+			ast_free(otw);
+		}
+	}
+	AST_VECTOR_RW_UNLOCK(&object_type_wizards);
+
 	AST_VECTOR_REMOVE_CMP_UNORDERED(&object_type_wizards, NULL, NOT_EQUALS, OTW_DELETE_CB);
 	AST_VECTOR_RW_FREE(&object_type_wizards);
 

-- 
To view, visit https://gerrit.asterisk.org/4049
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2823f77be83cf94a259ace7b30c31d50d9805d9b
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 14
Gerrit-Owner: Badalian Vyacheslav <v.badalyan at open-bs.ru>



More information about the asterisk-code-review mailing list