[gupnp] service-proxy: Do not keep action alive on error



commit e7f983760588668bdf80c7f2b1e22ea4de41a177
Author: Jens Georg <mail jensge org>
Date:   Thu May 20 12:27:24 2021 +0200

    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

 libgupnp/gupnp-service-proxy.c | 6 +++---
 1 file 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,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]