diff options
author | Nicolas Dufresne <nicolas.dufresne@collabora.com> | 2011-06-27 12:53:31 -0400 |
---|---|---|
committer | Nicolas Dufresne <nicolas.dufresne@collabora.com> | 2011-06-27 13:28:49 -0400 |
commit | 32a3d22201b141a3cebfbbb526f0101a1cf9a5ef (patch) | |
tree | 807daaca57ecd46558dc43bd67d94c140e4a5bd8 | |
parent | 3553a231152b43372fa46b20d83fff6886de5280 (diff) | |
download | telepathy-logger-32a3d22201b141a3cebfbbb526f0101a1cf9a5ef.tar.gz |
Fix action chain not to free result in finish
Freeing result in finish would lead to use after free since GLib push
and pop default thread context in complete() calls. Also, it's very bad
pratice as _finish() calls are optional.
-rw-r--r-- | telepathy-logger/action-chain.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/telepathy-logger/action-chain.c b/telepathy-logger/action-chain.c index df792e5..14b9452 100644 --- a/telepathy-logger/action-chain.c +++ b/telepathy-logger/action-chain.c @@ -109,7 +109,10 @@ void _tpl_action_chain_continue (TplActionChain *self) { if (g_queue_is_empty (self->chain)) - g_simple_async_result_complete (self->simple); + { + g_simple_async_result_complete (self->simple); + _tpl_action_chain_free (self); + } else { TplActionLink *l = g_queue_pop_head (self->chain); @@ -130,6 +133,7 @@ _tpl_action_chain_terminate (TplActionChain *self, g_simple_async_result_set_from_error (simple, error); g_simple_async_result_complete (simple); + _tpl_action_chain_free (self); } @@ -164,6 +168,5 @@ _tpl_action_chain_new_finish (GObject *source, error)) return FALSE; - _tpl_action_chain_free (chain); return TRUE; } |