vaapisink: fix minor memory leak in debug mode.
authorGwenole Beauchesne <gwenole.beauchesne@intel.com>
Mon, 2 Mar 2015 16:04:20 +0000 (17:04 +0100)
committerGwenole Beauchesne <gwenole.beauchesne@intel.com>
Fri, 6 Mar 2015 09:37:40 +0000 (10:37 +0100)
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

index dbd8388d1fff5ad9f236333d4b5e6c495ac7393a..7572c8e12b8f9a6d1e1013676d38352d118704ff 100644 (file)
@@ -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
 }