From 4c6e57ad33ca99cb3913a96a86c53926ba5abf32 Mon Sep 17 00:00:00 2001 From: Doug Nazar Date: Tue, 4 May 2021 20:45:19 -0400 Subject: [PATCH] rtsp-client: fix leak adding headers gst_rtsp_message_add_header() makes a copy of the header, instead of taking ownership. Part-of: --- gst/rtsp-server/rtsp-client.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gst/rtsp-server/rtsp-client.c b/gst/rtsp-server/rtsp-client.c index 8312e3c30b..e5a62c0cd9 100644 --- a/gst/rtsp-server/rtsp-client.c +++ b/gst/rtsp-server/rtsp-client.c @@ -3018,7 +3018,8 @@ handle_setup_request (GstRTSPClient * client, GstRTSPContext * ctx) (gdouble) seekable / GST_SECOND); gst_rtsp_message_add_header (ctx->response, GST_RTSP_HDR_MEDIA_PROPERTIES, - g_string_free (media_properties, FALSE)); + media_properties->str); + g_string_free (media_properties, TRUE); /* TODO Check how Accept-Ranges should be filled */ gst_rtsp_message_add_header (ctx->request, GST_RTSP_HDR_ACCEPT_RANGES, "npt, clock, smpte, clock");