[Asterisk-code-review] bridge softmix: Fix memory leaks. (asterisk[15])

Jenkins2 asteriskteam at digium.com
Tue Dec 19 09:43:57 CST 2017


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

Change subject: bridge_softmix: Fix memory leaks.
......................................................................

bridge_softmix: Fix memory leaks.

Change-Id: Ifaf3e93b398595d21d07f535330fef77ff15a80c
---
M bridges/bridge_softmix.c
1 file changed, 3 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/bridges/bridge_softmix.c b/bridges/bridge_softmix.c
index 8de88f2..6460a6e 100644
--- a/bridges/bridge_softmix.c
+++ b/bridges/bridge_softmix.c
@@ -672,6 +672,7 @@
 				ast_log(LOG_ERROR, "Bridge %s: Failed to join channel %s. "
 						"Could not allocate enough memory.\n", bridge->uniqueid,
 						ast_channel_name(bridge_channel->chan));
+				ast_free(sc);
 				return -1;
 			}
 		}
@@ -1306,6 +1307,8 @@
 		ast_log(LOG_NOTICE, "Failed to re-allocate softmix mixing structure.\n");
 		return -1;
 	}
+	mixing_array->buffers = tmp;
+
 	if (binaural_active) {
 		struct convolve_channel_pair **tmp2;
 		if (!(tmp2 = ast_realloc(mixing_array->chan_pairs,
@@ -1315,7 +1318,6 @@
 		}
 		mixing_array->chan_pairs = tmp2;
 	}
-	mixing_array->buffers = tmp;
 	return 0;
 }
 

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

Gerrit-Project: asterisk
Gerrit-Branch: 15
Gerrit-MessageType: merged
Gerrit-Change-Id: Ifaf3e93b398595d21d07f535330fef77ff15a80c
Gerrit-Change-Number: 7642
Gerrit-PatchSet: 1
Gerrit-Owner: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: 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/bb8aa2f5/attachment-0001.html>


More information about the asterisk-code-review mailing list