xvimagesink: fix error leak when context creation fails
authorVineeth TM <vineeth.tm@samsung.com>
Mon, 14 Sep 2015 00:36:20 +0000 (09:36 +0900)
committerTim-Philipp Müller <tim@centricular.com>
Mon, 14 Sep 2015 15:55:01 +0000 (16:55 +0100)
When context creation fails, error is getting leaked.

https://bugzilla.gnome.org/show_bug.cgi?id=754973

sys/xvimage/xvimagesink.c

index bc9f6bf..1f8729e 100644 (file)
@@ -1756,7 +1756,8 @@ no_context:
   {
     gst_element_message_full (GST_ELEMENT (xvimagesink), GST_MESSAGE_ERROR,
         error->domain, error->code, g_strdup ("Could not initialise Xv output"),
-        error->message, __FILE__, GST_FUNCTION, __LINE__);
+        g_strdup (error->message), __FILE__, GST_FUNCTION, __LINE__);
+    g_clear_error (&error);
     return FALSE;
   }
 }