summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorey Farrell <git@cfware.com>2017-11-16 20:39:20 -0500
committerCorey Farrell <git@cfware.com>2017-11-16 21:34:29 -0500
commit60d3dbdf841c7677d9307cc8e19ef9d54f8a7e23 (patch)
tree9d45c4642bb345fc1bbc3cd6953e6b0ba4c20b8b
parent4fb6b012c99d53c8864e21e1e570bbc74c756b21 (diff)
aoc: Fix memory management issues.
aoc_publish_blob failed to check for msg allocation error and never released msg. Change-Id: Ib31a9ffb81056a0d496a49d7eec795005a44bcd5
-rw-r--r--main/aoc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/main/aoc.c b/main/aoc.c
index 451b21973..3487948df 100644
--- a/main/aoc.c
+++ b/main/aoc.c
@@ -1860,7 +1860,10 @@ static void aoc_publish_blob(struct ast_channel *chan, struct stasis_message_typ
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,