[Asterisk-code-review] app voicemail: Fix memory management issues. (asterisk[master])

Jenkins2 asteriskteam at digium.com
Tue Dec 19 10:08:18 CST 2017


Jenkins2 has submitted this change and it was merged. ( https://gerrit.asterisk.org/7638 )

Change subject: app_voicemail: Fix memory management issues.
......................................................................

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
---
M apps/app_voicemail.c
1 file changed, 2 insertions(+), 1 deletion(-)

Approvals:
  Richard Mudgett: Looks good to me, but someone else must approve
  George Joseph: Looks good to me, approved
  Jenkins2: Approved for Submit



diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index c155186..af2174b 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -5390,6 +5390,7 @@
 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;
 
@@ -5399,7 +5400,6 @@
 	/* 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");
 
@@ -13167,6 +13167,7 @@
 	}
 
 	if (separate_mailbox(ast_strdupa(stasis_topic_name(change->topic)), &mailbox, &context)) {
+		ast_free(mwist);
 		return;
 	}
 

-- 
To view, visit https://gerrit.asterisk.org/7638
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I6282c542ff7b82fa091177a912d11234a8b00a30
Gerrit-Change-Number: 7638
Gerrit-PatchSet: 1
Gerrit-Owner: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20171219/4efe7d75/attachment.html>


More information about the asterisk-code-review mailing list