From fe283a9aeb62ad0a0f56c02772339153c1df96af Mon Sep 17 00:00:00 2001 From: Nicolas Dufresne Date: Fri, 26 Jun 2015 15:34:35 -0400 Subject: gl: Don't leak pool if set_config failed --- ext/gl/gstglmixer.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'ext/gl') diff --git a/ext/gl/gstglmixer.c b/ext/gl/gstglmixer.c index 119ab5a35..401e4ed6c 100644 --- a/ext/gl/gstglmixer.c +++ b/ext/gl/gstglmixer.c @@ -165,13 +165,14 @@ gst_gl_mixer_propose_allocation (GstGLBaseMixer * base_mix, config = gst_buffer_pool_get_config (pool); gst_buffer_pool_config_set_params (config, caps, size, 0, 0); - if (!gst_buffer_pool_set_config (pool, config)) + + if (!gst_buffer_pool_set_config (pool, config)) { + g_object_unref (pool); goto config_failed; - } + } - if (pool) { gst_query_add_allocation_pool (query, pool, size, 1, 0); - gst_object_unref (pool); + g_object_unref (pool); } /* we also support various metadata */ -- cgit v1.2.1