diff options
author | Corey Farrell <git@cfware.com> | 2017-11-06 15:23:46 -0500 |
---|---|---|
committer | Corey Farrell <git@cfware.com> | 2017-11-06 15:23:46 -0500 |
commit | 64bcb65a7836cc0415852637b46cba6cba4cf173 (patch) | |
tree | f6842027211af20da5d836c80fcd563a860ba992 /main/stasis.c | |
parent | 637b37fb980822f50966f5292a786d03a859cd89 (diff) |
stasis: Remove silly use of RAII_VAR in stasis_forward_all.
Change-Id: I46de4c968d40144d5b049966304ff66c1469fb65
Diffstat (limited to 'main/stasis.c')
-rw-r--r-- | main/stasis.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/main/stasis.c b/main/stasis.c index a82e938f4..74d5df8fd 100644 --- a/main/stasis.c +++ b/main/stasis.c @@ -908,7 +908,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; @@ -921,7 +921,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); @@ -932,6 +932,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; } @@ -941,7 +942,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) |