Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
asterisk, upstream fix for ASTERISK-28215
- Loading branch information
Showing
1 changed file
with
46 additions
and
0 deletions.
There are no files selected for viewing
46 changes: 46 additions & 0 deletions
46
package/asterisk/asterisk-13-upstream-ASTERISK-28215.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
} |