[Asterisk-code-review] app queue.c: Fix json ref leak (asterisk[13])

Joshua Colp asteriskteam at digium.com
Tue Oct 2 08:46:33 CDT 2018


Joshua Colp has submitted this change and it was merged. ( https://gerrit.asterisk.org/10337 )

Change subject: app_queue.c: Fix json ref leak
......................................................................

app_queue.c: Fix json ref leak

Declining the queue_member_status_type stasis message in stasis.conf
causes these messages to leak json objects.

* Add missing ast_json_unref() if the type is NULL in
queue_publish_member_blob().

ASTERISK-28084

Change-Id: I691ecf49bd1f7d9c29182e1eee8c4bb7103be9fc
---
M apps/app_queue.c
1 file changed, 1 insertion(+), 0 deletions(-)

Approvals:
  Joshua Colp: Looks good to me, but someone else must approve; Approved for Submit
  Corey Farrell: Looks good to me, but someone else must approve
  George Joseph: Looks good to me, approved



diff --git a/apps/app_queue.c b/apps/app_queue.c
index 50f9029..eb85c51 100644
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -2154,6 +2154,7 @@
 	RAII_VAR(struct stasis_message *, msg, NULL, ao2_cleanup);
 
 	if (!blob || !type) {
+		ast_json_unref(blob);
 		return;
 	}
 

-- 
To view, visit https://gerrit.asterisk.org/10337
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-MessageType: merged
Gerrit-Change-Id: I691ecf49bd1f7d9c29182e1eee8c4bb7103be9fc
Gerrit-Change-Number: 10337
Gerrit-PatchSet: 1
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2 (1000185)
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20181002/7d64fe7c/attachment.html>


More information about the asterisk-code-review mailing list