libs: gl: Fix a context leak when display_create_context failed
authorHe Junyan <junyan.he@hotmail.com>
Wed, 8 Apr 2020 07:26:23 +0000 (15:26 +0800)
committerHe Junyan <junyan.he@hotmail.com>
Wed, 8 Apr 2020 07:26:23 +0000 (15:26 +0800)
gst-libs/gst/gl/gstgldisplay.c

index f121330..a5210a4 100644 (file)
@@ -573,6 +573,8 @@ gst_gl_display_create_context (GstGLDisplay * display,
 
   if (ret)
     *p_context = context;
+  else
+    gst_object_unref (context);
 
   return ret;
 }