diff options
author | Ludovic Ferrandis <ludovic.ferrandis@intel.com> | 2013-04-10 16:45:57 +0200 |
---|---|---|
committer | Mark Ryan <mark.d.ryan@intel.com> | 2013-04-11 13:11:30 +0200 |
commit | 365931a6a2470c394f245c38e2c018784f28f5b3 (patch) | |
tree | 0da07f17c2a55e85a90c322c1915e59b1a96836b /libdleyna | |
parent | e4a3e75550ce9f72a7ff6b3946e195d239ec873f (diff) | |
download | dleyna-renderer-365931a6a2470c394f245c38e2c018784f28f5b3.tar.gz |
[GUPnP] Fix bug introduced in previous commit when managing error.
Signed-off-by: Ludovic Ferrandis <ludovic.ferrandis@intel.com>
Diffstat (limited to 'libdleyna')
-rw-r--r-- | libdleyna/renderer/device.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/libdleyna/renderer/device.c b/libdleyna/renderer/device.c index 2cd0acc..b1f94f0 100644 --- a/libdleyna/renderer/device.c +++ b/libdleyna/renderer/device.c @@ -647,6 +647,7 @@ static void prv_get_protocol_info_cb(GUPnPServiceProxy *proxy, gpointer user_data) { gchar *result = NULL; + const gchar *message; gboolean end; GError *error = NULL; prv_new_device_ct_t *priv_t = (prv_new_device_ct_t *)user_data; @@ -656,8 +657,9 @@ static void prv_get_protocol_info_cb(GUPnPServiceProxy *proxy, end = gupnp_service_proxy_end_action(proxy, action, &error, "Sink", G_TYPE_STRING, &result, NULL); if (!end || (result == NULL)) { + message = (error != NULL) ? error->message : "Invalid result"; DLEYNA_LOG_WARNING("GetProtocolInfo operation failed: %s", - error->message); + message); goto on_error; } @@ -1558,23 +1560,23 @@ static void prv_get_position_info_cb(GUPnPServiceProxy *proxy, gpointer user_data) { gchar *rel_pos = NULL; + const gchar *message; gboolean end; dlr_async_task_t *cb_data = user_data; - GError *upnp_error = NULL; + GError *error = NULL; dlr_device_data_t *device_data = cb_data->private; GVariantBuilder *changed_props_vb; GVariant *changed_props; end = gupnp_service_proxy_end_action(cb_data->proxy, cb_data->action, - &upnp_error, "RelTime", + &error, "RelTime", G_TYPE_STRING, &rel_pos, NULL); if (!end || (rel_pos == NULL)) { + message = (error != NULL) ? error->message : "Invalid result"; cb_data->error = g_error_new(DLEYNA_SERVER_ERROR, DLEYNA_ERROR_OPERATION_FAILED, "GetPositionInfo operation failed: %s", - upnp_error->message); - g_error_free(upnp_error); - + message); goto on_error; } @@ -1594,6 +1596,9 @@ static void prv_get_position_info_cb(GUPnPServiceProxy *proxy, on_error: + if (error != NULL) + g_error_free(error); + device_data->local_cb(cb_data); } |