[asterisk-commits] rmudgett: trunk r399584 - in /trunk: ./ apps/app_queue.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Sep 20 19:23:47 CDT 2013


Author: rmudgett
Date: Fri Sep 20 19:23:45 2013
New Revision: 399584

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=399584
Log:
app_queue: Fix json blob ref leak.

The json ref from queue_member_blob_create() was never released.
........

Merged revisions 399583 from http://svn.asterisk.org/svn/asterisk/branches/12

Modified:
    trunk/   (props changed)
    trunk/apps/app_queue.c

Propchange: trunk/
------------------------------------------------------------------------------
--- branch-12-merged (original)
+++ branch-12-merged Fri Sep 20 19:23:45 2013
@@ -1,1 +1,1 @@
-/branches/12:1-398558,398560-398577,398579-399100,399136,399146,399160,399197,399207,399225,399237,399247,399257,399268,399283,399294,399339,399365,399376,399404,399458,399501,399514,399531,399553,399565,399576
+/branches/12:1-398558,398560-398577,398579-399100,399136,399146,399160,399197,399207,399225,399237,399247,399257,399268,399283,399294,399339,399365,399376,399404,399458,399501,399514,399531,399553,399565,399576,399583

Modified: trunk/apps/app_queue.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_queue.c?view=diff&rev=399584&r1=399583&r2=399584
==============================================================================
--- trunk/apps/app_queue.c (original)
+++ trunk/apps/app_queue.c Fri Sep 20 19:23:45 2013
@@ -1952,12 +1952,29 @@
 			agent_snapshot, type, blob);
 }
 
+/*!
+ * \internal
+ * \brief Publish the member blob.
+ * \since 12.0.0
+ *
+ * \param type Stasis message type to publish.
+ * \param blob The information being published.
+ *
+ * \note The json blob reference is passed to this function.
+ *
+ * \return Nothing
+ */
 static void queue_publish_member_blob(struct stasis_message_type *type, struct ast_json *blob)
 {
 	RAII_VAR(struct ast_json_payload *, payload, NULL, ao2_cleanup);
 	RAII_VAR(struct stasis_message *, msg, NULL, ao2_cleanup);
 
+	if (!blob) {
+		return;
+	}
+
 	payload = ast_json_payload_create(blob);
+	ast_json_unref(blob);
 	if (!payload) {
 		return;
 	}
@@ -6729,7 +6746,8 @@
 	return res;
 }
 
-static int publish_queue_member_pause(struct call_queue *q, struct member *member, const char *reason) {
+static int publish_queue_member_pause(struct call_queue *q, struct member *member, const char *reason)
+{
 	struct ast_json *json_blob = queue_member_blob_create(q, member);
 
 	if (!json_blob) {




More information about the asterisk-commits mailing list