diff options
author | Jens Georg <mail@jensge.org> | 2021-05-20 12:27:24 +0200 |
---|---|---|
committer | Jens Georg <mail@jensge.org> | 2021-05-20 12:52:34 +0200 |
commit | e7f983760588668bdf80c7f2b1e22ea4de41a177 (patch) | |
tree | d7beb4ddb080134bccb1c087f50b14ea933bb725 | |
parent | 35bba25ca93701e330ea258f15f0310f11b27774 (diff) | |
download | gupnp-e7f983760588668bdf80c7f2b1e22ea4de41a177.tar.gz |
service-proxy: Do not keep action alive on error
We always need to remove the action from the queue, this was not done on
error which could lead to a dangling pointer in the queue
-rw-r--r-- | libgupnp/gupnp-service-proxy.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libgupnp/gupnp-service-proxy.c b/libgupnp/gupnp-service-proxy.c index 0201638..56bb438 100644 --- a/libgupnp/gupnp-service-proxy.c +++ b/libgupnp/gupnp-service-proxy.c @@ -2152,6 +2152,9 @@ gupnp_service_proxy_call_action (GUPnPServiceProxy *proxy, prepare_action_msg (proxy, action, cancellable); + /* prepare_action_msg has queued the message, so remove it */ + gupnp_service_proxy_remove_action (proxy, action); + if (action->error != NULL) { g_propagate_error (error, g_error_copy (action->error)); @@ -2168,9 +2171,6 @@ gupnp_service_proxy_call_action (GUPnPServiceProxy *proxy, soup_session_send_message (session, action->msg); } - /* prepare_action_msg has queued the message, so remove it */ - gupnp_service_proxy_remove_action (proxy, action); - if (action->msg->status_code == SOUP_STATUS_CANCELLED) { action->error = g_error_new (G_IO_ERROR, G_IO_ERROR_CANCELLED, |