gl/wayland: Memory leak when display couldn't connect
authorVíctor Manuel Jáquez Leal <vjaquez@igalia.com>
Thu, 15 Feb 2018 10:21:34 +0000 (11:21 +0100)
committerVíctor Manuel Jáquez Leal <vjaquez@igalia.com>
Fri, 16 Feb 2018 12:56:50 +0000 (13:56 +0100)
When trying to create a wayland display, it may fail because there
is not actually display to connect. It this case NULL is returned
but the created instance is not freed.

This patch unrefs the failed display.

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

gst-libs/gst/gl/wayland/gstgldisplay_wayland.c

index 054dcf4327ba5e201ecc2f4c190c1fa5101d26e5..6760ecea36428629619dd063b4ba1be29ed9d164 100644 (file)
@@ -130,6 +130,7 @@ gst_gl_display_wayland_new (const gchar * name)
     } else {
       GST_INFO ("Failed to open Wayland display connection.");
     }
+    gst_object_unref (ret);
     return NULL;
   }