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 dbd8388..7572c8e 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
 }