diff options
author | Corey Farrell <git@cfware.com> | 2017-12-18 19:04:56 -0500 |
---|---|---|
committer | Corey Farrell <git@cfware.com> | 2017-12-18 18:12:31 -0600 |
commit | 1d636f4afa7c9c885f2d7feb03be094155ae05d6 (patch) | |
tree | 2ab50d35c9a87837c4c36a4c1c91c90d5c8e9f4e | |
parent | b14d16592790f681c5e2e1c5d80fbe0eb92bf358 (diff) |
app_voicemail: Fix memory management issues.
* mwi_sub_event_cb: mwist leaked on separate_mailbox failure.
* add_email_attachment: A reference to sox_gain_tmpdir was used
after the storage was out of scope.
Change-Id: I6282c542ff7b82fa091177a912d11234a8b00a30
-rw-r--r-- | apps/app_voicemail.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c index c080bfee9..4a0dacc05 100644 --- a/apps/app_voicemail.c +++ b/apps/app_voicemail.c @@ -5373,6 +5373,7 @@ plain_message: static int add_email_attachment(FILE *p, struct ast_vm_user *vmu, char *format, char *attach, char *greeting_attachment, char *mailbox, char *bound, char *filename, int last, int msgnum) { char fname[PATH_MAX] = ""; + char sox_gain_tmpdir[PATH_MAX]; char *file_to_delete = NULL, *dir_to_delete = NULL; int res; @@ -5382,7 +5383,6 @@ static int add_email_attachment(FILE *p, struct ast_vm_user *vmu, char *format, /* This 'while' loop will only execute once. We use it so that we can 'break' */ while (vmu->volgain < -.001 || vmu->volgain > .001) { char tmpdir[PATH_MAX]; - char sox_gain_tmpdir[PATH_MAX]; create_dirpath(tmpdir, sizeof(tmpdir), vmu->context, vmu->mailbox, "tmp"); @@ -13212,6 +13212,7 @@ static void mwi_sub_event_cb(struct stasis_subscription_change *change) } if (separate_mailbox(ast_strdupa(stasis_topic_name(change->topic)), &mailbox, &context)) { + ast_free(mwist); return; } |