summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2017-11-07 08:52:39 -0600
committerGerrit Code Review <gerrit2@gerrit.digium.api>2017-11-07 08:52:39 -0600
commit315ccf40f403085601ab21b0985196c8125dd4cb (patch)
tree3651ce2da78fd79bd4e9057ad7e9f59c84fa27af
parentec40b74e51e10f455ee8141a0537dc0f761b2ec4 (diff)
parent803dc3dee50c1aac6f024abf3c77463dc86acfa9 (diff)
Merge "stasis: Remove silly use of RAII_VAR in stasis_forward_all." into 13
-rw-r--r--main/stasis.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/main/stasis.c b/main/stasis.c
index 2d9980517..ad3fce584 100644
--- a/main/stasis.c
+++ b/main/stasis.c
@@ -910,7 +910,7 @@ struct stasis_forward *stasis_forward_all(struct stasis_topic *from_topic,
{
int res;
size_t idx;
- RAII_VAR(struct stasis_forward *, forward, NULL, ao2_cleanup);
+ struct stasis_forward *forward;
if (!from_topic || !to_topic) {
return NULL;
@@ -923,7 +923,7 @@ struct stasis_forward *stasis_forward_all(struct stasis_topic *from_topic,
/* Forwards to ourselves are implicit. */
if (to_topic == from_topic) {
- return ao2_bump(forward);
+ return forward;
}
forward->from_topic = ao2_bump(from_topic);
@@ -934,6 +934,7 @@ struct stasis_forward *stasis_forward_all(struct stasis_topic *from_topic,
if (res != 0) {
ao2_unlock(from_topic);
ao2_unlock(to_topic);
+ ao2_ref(forward, -1);
return NULL;
}
@@ -943,7 +944,7 @@ struct stasis_forward *stasis_forward_all(struct stasis_topic *from_topic,
ao2_unlock(from_topic);
ao2_unlock(to_topic);
- return ao2_bump(forward);
+ return forward;
}
static void subscription_change_dtor(void *obj)