Skip to content

Commit

Permalink
asterisk, upstream fix for ASTERISK-28215
Browse files Browse the repository at this point in the history
  • Loading branch information
abelbeck committed Jan 9, 2019
1 parent 6d60790 commit 3bfd9f0
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions package/asterisk/asterisk-13-upstream-ASTERISK-28215.patch
@@ -0,0 +1,46 @@
X-Git-Url: http://git.asterisk.org/gitweb/?p=asterisk%2Fasterisk.git;a=blobdiff_plain;f=apps%2Fapp_voicemail.c;h=1dd7aa0d07263315f53bd93203237849fca30e90;hp=85e1c38e00b823c624b5a7700e05947b1c503f37;hb=e137086163b00ce4947aa9335aae7f45956bbe75;hpb=ead94ad6213ce91b42151639fa6d10b5d8b8066b

diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 85e1c38..1dd7aa0 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -2026,10 +2026,6 @@ static void free_user(struct ast_vm_user *vmu)
return;
}

- if (!ast_strlen_zero(vmu->mailbox)) {
- ast_delete_mwi_state_full(vmu->mailbox, vmu->context, NULL);
- }
-
ast_free(vmu->email);
vmu->email = NULL;
ast_free(vmu->emailbody);
@@ -2042,6 +2038,19 @@ static void free_user(struct ast_vm_user *vmu)
}
}

+static void free_user_final(struct ast_vm_user *vmu)
+{
+ if (!vmu) {
+ return;
+ }
+
+ if (!ast_strlen_zero(vmu->mailbox)) {
+ ast_delete_mwi_state_full(vmu->mailbox, vmu->context, NULL);
+ }
+
+ free_user(vmu);
+}
+
static int vm_allocate_dh(struct vm_state *vms, struct ast_vm_user *vmu, int count_msg) {

int arraysize = (vmu->maxmsg > count_msg ? vmu->maxmsg : count_msg);
@@ -13491,7 +13500,7 @@ static void free_vm_users(void)
AST_LIST_LOCK(&users);
while ((current = AST_LIST_REMOVE_HEAD(&users, list))) {
ast_set_flag(current, VM_ALLOCED);
- free_user(current);
+ free_user_final(current);
}
AST_LIST_UNLOCK(&users);
}

0 comments on commit 3bfd9f0

Please sign in to comment.