summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Georg <mail@jensge.org>2022-01-01 19:11:25 +0100
committerJens Georg <mail@jensge.org>2022-01-01 19:14:48 +0100
commit0cb305b4ae1e7f999392aa69d549bce4827eb1a3 (patch)
tree51e38f33a1c7b351d33b01aa6a8130b6c1fdadad
parent5e0af4b6741f891eb5650a1f0eb550d50535a48e (diff)
downloadgupnp-0cb305b4ae1e7f999392aa69d549bce4827eb1a3.tar.gz
ServiceProxy: Do not leak the action body
-rw-r--r--libgupnp/gupnp-service-proxy.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/libgupnp/gupnp-service-proxy.c b/libgupnp/gupnp-service-proxy.c
index 24a99c6..3c65414 100644
--- a/libgupnp/gupnp-service-proxy.c
+++ b/libgupnp/gupnp-service-proxy.c
@@ -691,10 +691,12 @@ prepare_action_msg (GUPnPServiceProxy *proxy,
gupnp_service_proxy_action_serialize (action, service_type);
- soup_message_set_request_body_from_bytes (
- action->msg,
- "text/xml; charset=\"utf-8\"",
- g_string_free_to_bytes (action->msg_str));
+ GBytes *body = g_string_free_to_bytes (action->msg_str);
+
+ soup_message_set_request_body_from_bytes (action->msg,
+ "text/xml; charset=\"utf-8\"",
+ body);
+ g_bytes_unref (body);
action->msg_str = NULL;
return TRUE;