[Asterisk-code-review] app_voicemail: Fix module unload leak. (...asterisk[master])

Kevin Harwell asteriskteam at digium.com
Mon Sep 23 15:28:27 CDT 2019


Kevin Harwell has submitted this change and it was merged. ( https://gerrit.asterisk.org/c/asterisk/+/12902 )

Change subject: app_voicemail: Fix module unload leak.
......................................................................

app_voicemail: Fix module unload leak.

Change-Id: Ib9a06565b9a178822d3bbb67eccf51432e12d84a
---
M apps/app_voicemail.c
1 file changed, 7 insertions(+), 0 deletions(-)

Approvals:
  George Joseph: Looks good to me, but someone else must approve
  Benjamin Keith Ford: Looks good to me, but someone else must approve
  Kevin Harwell: Looks good to me, approved; Approved for Submit



diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index a479728..fe1ce34 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -15154,6 +15154,11 @@
 #endif
 	ao2_ref(inprocess_container, -1);
 
+	ao2_container_unregister("voicemail_alias_mailbox_mappings");
+	ao2_cleanup(alias_mailbox_mappings);
+	ao2_container_unregister("voicemail_mailbox_alias_mappings");
+	ao2_cleanup(mailbox_alias_mappings);
+
 	if (poll_thread != AST_PTHREADT_NULL)
 		stop_poll_thread();
 
@@ -15225,6 +15230,7 @@
 	if (!mailbox_alias_mappings) {
 		ast_log(LOG_ERROR, "Unable to create mailbox_alias_mappings container\n");
 		ao2_cleanup(inprocess_container);
+		ao2_container_unregister("voicemail_alias_mailbox_mappings");
 		ao2_cleanup(alias_mailbox_mappings);
 		return AST_MODULE_LOAD_DECLINE;
 	}
@@ -15232,6 +15238,7 @@
 	if (res) {
 		ast_log(LOG_ERROR, "Unable to register mailbox_alias_mappings container\n");
 		ao2_cleanup(inprocess_container);
+		ao2_container_unregister("voicemail_alias_mailbox_mappings");
 		ao2_cleanup(alias_mailbox_mappings);
 		ao2_cleanup(mailbox_alias_mappings);
 		return AST_MODULE_LOAD_DECLINE;

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/12902
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: Ib9a06565b9a178822d3bbb67eccf51432e12d84a
Gerrit-Change-Number: 12902
Gerrit-PatchSet: 1
Gerrit-Owner: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: Benjamin Keith Ford <bford at digium.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20190923/c4136a6e/attachment.html>


More information about the asterisk-code-review mailing list