diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2012-02-09 13:24:57 +0000 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2012-02-09 13:25:04 +0000 |
commit | 4d43c14e47ae3b67a83ff88bc39c34e02ad15434 (patch) | |
tree | beaaac15b6b503b92c8a9f66c1e5544824320876 /telepathy-glib/account.c | |
parent | f91744d3cfe0083338e03abc2ada88c9df7cb9d5 (diff) | |
download | telepathy-glib-4d43c14e47ae3b67a83ff88bc39c34e02ad15434.tar.gz |
tp_account_update_parameters_async: fix lifetime of result, and test it
Without this change to TpAccount, the test would fail with a
use-after-free while inspecting reconnect_required. The TpAccount code
assumed that _finish would always be called directly from the callback,
but it is perfectly valid not to do so.
In the test, also test Reconnect (which is currently unimplemented),
since UpdateParameters and Reconnect are so closely related.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=45554
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
Diffstat (limited to 'telepathy-glib/account.c')
-rw-r--r-- | telepathy-glib/account.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/telepathy-glib/account.c b/telepathy-glib/account.c index 8eb3aaf65..dc8ca74c8 100644 --- a/telepathy-glib/account.c +++ b/telepathy-glib/account.c @@ -2586,7 +2586,8 @@ _tp_account_updated_cb (TpAccount *proxy, if (error != NULL) g_simple_async_result_set_from_error (result, error); else - g_simple_async_result_set_op_res_gpointer (result, reconnect_required, NULL); + g_simple_async_result_set_op_res_gpointer (result, + g_strdupv ((GStrv) reconnect_required), (GDestroyNotify) g_strfreev); g_simple_async_result_complete (result); g_object_unref (G_OBJECT (result)); |