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

Jenkins2 asteriskteam at digium.com
Fri Nov 17 06:43:18 CST 2017


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

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

aoc: Fix memory management issues.

aoc_publish_blob failed to check for msg allocation error and never
released msg.

Change-Id: Ib31a9ffb81056a0d496a49d7eec795005a44bcd5
---
M main/aoc.c
1 file changed, 4 insertions(+), 1 deletion(-)

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



diff --git a/main/aoc.c b/main/aoc.c
index 451b219..3487948 100644
--- a/main/aoc.c
+++ b/main/aoc.c
@@ -1860,7 +1860,10 @@
 	msg = stasis_message_create(msg_type, aoc_event);
 	ao2_ref(aoc_event, -1);
 
-	stasis_publish(ast_manager_get_topic(), msg);
+	if (msg) {
+		stasis_publish(ast_manager_get_topic(), msg);
+		ao2_ref(msg, -1);
+	}
 }
 
 static struct ast_manager_event_blob *aoc_to_ami(struct stasis_message *message,

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

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ib31a9ffb81056a0d496a49d7eec795005a44bcd5
Gerrit-Change-Number: 7248
Gerrit-PatchSet: 1
Gerrit-Owner: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
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/20171117/737a6e72/attachment.html>


More information about the asterisk-code-review mailing list