diff options
author | Jenkins2 <jenkins2@gerrit.asterisk.org> | 2017-11-07 16:11:13 -0600 |
---|---|---|
committer | Gerrit Code Review <gerrit2@gerrit.digium.api> | 2017-11-07 16:11:13 -0600 |
commit | 841fc3e5c266618e5d38bb01f1bbe3e6112a3e38 (patch) | |
tree | 5d3af81a96a4e5877a53b550a557cfb4ec73061f | |
parent | 7657519a537aa0361c8331e570d8bf27493430fc (diff) | |
parent | 3dc600ef8435ae7c9799d62e9124c82af37d0bdc (diff) |
Merge "stasis: Release object if vector append fails." into 13
-rw-r--r-- | main/stasis.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/main/stasis.c b/main/stasis.c index ad3fce584..63d17dfaf 100644 --- a/main/stasis.c +++ b/main/stasis.c @@ -1242,10 +1242,9 @@ struct ast_multi_object_blob *ast_multi_object_blob_create(struct ast_json *blob void ast_multi_object_blob_add(struct ast_multi_object_blob *multi, enum stasis_user_multi_object_snapshot_type type, void *object) { - if (!multi || !object) { - return; + if (!multi || !object || AST_VECTOR_APPEND(&multi->snapshots[type], object)) { + ao2_cleanup(object); } - AST_VECTOR_APPEND(&multi->snapshots[type],object); } /*! \brief Publish single channel user event (for app_userevent compatibility) */ |