From 7524b5eea620f97bbd2ff02507fa0433c602d7da Mon Sep 17 00:00:00 2001 From: Gwenole Beauchesne Date: Mon, 2 Mar 2015 17:04:20 +0100 Subject: [PATCH] vaapisink: fix minor memory leak in debug mode. The gst_video_colorimetry_to_string() function returns a newly created string that represents the GstVideoColorimetry value. So, that needs to be released after usage, in e.g. GST_DEBUG(). --- gst/vaapi/gstvaapisink.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gst/vaapi/gstvaapisink.c b/gst/vaapi/gstvaapisink.c index dbd8388d1f..7572c8e12b 100644 --- a/gst/vaapi/gstvaapisink.c +++ b/gst/vaapi/gstvaapisink.c @@ -1282,7 +1282,13 @@ update_colorimetry (GstVaapiSink * sink, GstVideoColorimetry * cinfo) else sink->color_standard = 0; - GST_DEBUG ("colorimetry %s", gst_video_colorimetry_to_string (cinfo)); +#ifndef GST_DISABLE_GST_DEBUG + { + gchar *const colorimetry_string = gst_video_colorimetry_to_string (cinfo); + GST_DEBUG ("colorimetry %s", colorimetry_string); + g_free (colorimetry_string); + } +#endif #endif }