From 1784f628950cfd19e0e164a08e1564339e92fc76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Manuel=20J=C3=A1quez=20Leal?= Date: Thu, 15 Feb 2018 11:21:34 +0100 Subject: [PATCH] gl/wayland: Memory leak when display couldn't connect 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 | 1 + 1 file changed, 1 insertion(+) diff --git a/gst-libs/gst/gl/wayland/gstgldisplay_wayland.c b/gst-libs/gst/gl/wayland/gstgldisplay_wayland.c index 054dcf4327..6760ecea36 100644 --- a/gst-libs/gst/gl/wayland/gstgldisplay_wayland.c +++ b/gst-libs/gst/gl/wayland/gstgldisplay_wayland.c @@ -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; }