diff options
author | Jens Georg <mail@jensge.org> | 2022-01-01 19:11:25 +0100 |
---|---|---|
committer | Jens Georg <mail@jensge.org> | 2022-01-01 19:14:48 +0100 |
commit | 0cb305b4ae1e7f999392aa69d549bce4827eb1a3 (patch) | |
tree | 51e38f33a1c7b351d33b01aa6a8130b6c1fdadad | |
parent | 5e0af4b6741f891eb5650a1f0eb550d50535a48e (diff) | |
download | gupnp-0cb305b4ae1e7f999392aa69d549bce4827eb1a3.tar.gz |
ServiceProxy: Do not leak the action body
-rw-r--r-- | libgupnp/gupnp-service-proxy.c | 10 |
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; |