summaryrefslogtreecommitdiff
path: root/apps/app_queue.c
diff options
context:
space:
mode:
authorRichard Mudgett <rmudgett@digium.com>2013-09-21 00:23:45 +0000
committerRichard Mudgett <rmudgett@digium.com>2013-09-21 00:23:45 +0000
commit5afbc01d5d5f93143079417dce2767aab7799460 (patch)
tree70f38f6e3e67a26ebcbcd3933399def3e9c810be /apps/app_queue.c
parent120abb5ecd72fefa6aadccabf51ee4af984ee522 (diff)
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 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@399584 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps/app_queue.c')
-rw-r--r--apps/app_queue.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/apps/app_queue.c b/apps/app_queue.c
index cfec634fa..0dd820bea 100644
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -1952,12 +1952,29 @@ static void queue_publish_multi_channel_blob(struct ast_channel *caller, struct
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 @@ static int add_to_queue(const char *queuename, const char *interface, const char
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) {