diff options
author | Jonathan Rose <jrose@digium.com> | 2013-10-24 18:46:56 +0000 |
---|---|---|
committer | Jonathan Rose <jrose@digium.com> | 2013-10-24 18:46:56 +0000 |
commit | 713ac0872bc23dbcaf27d6752e49a32c2dd94ec0 (patch) | |
tree | 74836b989bb8a7c79c066253105cb9e9ef92b128 /apps/app_voicemail.c | |
parent | 4ca0f222e85554e24d5cfb7d48b3a774d96a6e45 (diff) |
app_voicemail: Memory Leaks against tests
(issue ASTERISK-22467)
Reported by: Corey Farrell
Patches:
app_voicemail-1.8.patch uploaded by coreyfarrell (license 5909)
app_voicemail-11up.patch uploaded by coreyfarrell (license 5909)
........
Merged revisions 401743 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 401744 from http://svn.asterisk.org/svn/asterisk/branches/11
........
Merged revisions 401745 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@401746 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps/app_voicemail.c')
-rw-r--r-- | apps/app_voicemail.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c index 1ab164511..1da52194b 100644 --- a/apps/app_voicemail.c +++ b/apps/app_voicemail.c @@ -11994,6 +11994,7 @@ static int acf_mailbox_exists(struct ast_channel *chan, const char *cmd, char *a static int acf_vm_info(struct ast_channel *chan, const char *cmd, char *args, char *buf, size_t len) { + struct ast_vm_user svm; struct ast_vm_user *vmu = NULL; char *tmp, *mailbox, *context, *parse; int res = 0; @@ -12027,7 +12028,7 @@ static int acf_vm_info(struct ast_channel *chan, const char *cmd, char *args, ch context = "default"; } - vmu = find_user(NULL, context, mailbox); + vmu = find_user(&svm, context, mailbox); if (!strncasecmp(arg.attribute, "exists", 5)) { ast_copy_string(buf, vmu ? "1" : "0", len); @@ -13788,6 +13789,7 @@ AST_TEST_DEFINE(test_voicemail_msgcount) { int i, j, res = AST_TEST_PASS, syserr; struct ast_vm_user *vmu; + struct ast_vm_user svm; struct vm_state vms; #ifdef IMAP_STORAGE struct ast_channel *chan = NULL; @@ -13840,7 +13842,7 @@ AST_TEST_DEFINE(test_voicemail_msgcount) } #endif - if (!(vmu = find_user(NULL, testcontext, testmailbox)) && + if (!(vmu = find_user(&svm, testcontext, testmailbox)) && !(vmu = find_or_create(testcontext, testmailbox))) { ast_test_status_update(test, "Cannot create vmu structure\n"); ast_unreplace_sigchld(); |