[gupnp] ServiceAction: Do not leak answer bytes



commit 31ceb3c8ab430cd5f3a69498d19d2c49621dadf6
Author: Jens Georg <mail jensge org>
Date:   Sun Jan 9 13:47:31 2022 +0100

    ServiceAction: Do not leak answer bytes

 libgupnp/gupnp-service-action.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/libgupnp/gupnp-service-action.c b/libgupnp/gupnp-service-action.c
index cd5f52a..3dc71a4 100644
--- a/libgupnp/gupnp-service-action.c
+++ b/libgupnp/gupnp-service-action.c
@@ -106,9 +106,9 @@ finalize_action (GUPnPServiceAction *action)
         } else {
                 SoupMessageBody *msg_body =
                         soup_server_message_get_response_body (action->msg);
-                soup_message_body_append_bytes (
-                        msg_body,
-                        g_string_free_to_bytes (action->response_str));
+                GBytes *bytes = g_string_free_to_bytes (action->response_str);
+                soup_message_body_append_bytes (msg_body, bytes);
+                g_bytes_unref (bytes);
         }
         action->response_str = NULL;
 


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