From 9fc1d9b8c4248fb28868b672aa22f4d25f1c7ec2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Dzi=C4=99giel?= Date: Wed, 15 Sep 2021 16:28:23 +0200 Subject: [PATCH] sink: Do not leak pool when set config fails --- lib/gst/clapper/gtk4/gstclapperglsink.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/gst/clapper/gtk4/gstclapperglsink.c b/lib/gst/clapper/gtk4/gstclapperglsink.c index dbd34c04..14a99ecd 100644 --- a/lib/gst/clapper/gtk4/gstclapperglsink.c +++ b/lib/gst/clapper/gtk4/gstclapperglsink.c @@ -372,8 +372,10 @@ gst_clapper_gl_sink_propose_allocation (GstBaseSink * bsink, GstQuery * query) gst_buffer_pool_config_add_option (config, GST_BUFFER_POOL_OPTION_GL_SYNC_META); - if (!gst_buffer_pool_set_config (pool, config)) + if (!gst_buffer_pool_set_config (pool, config)) { + gst_object_unref (pool); goto config_failed; + } } /* we need at least 2 buffer because we hold on to the last one */