sink: Do not leak pool when set config fails

This commit is contained in:
Rafał Dzięgiel
2021-09-15 16:28:23 +02:00
parent 45a5ebb4b6
commit 9fc1d9b8c4

View File

@@ -372,9 +372,11 @@ gst_clapper_gl_sink_propose_allocation (GstBaseSink * bsink, GstQuery * query)
gst_buffer_pool_config_add_option (config, gst_buffer_pool_config_add_option (config,
GST_BUFFER_POOL_OPTION_GL_SYNC_META); 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; goto config_failed;
} }
}
/* we need at least 2 buffer because we hold on to the last one */ /* we need at least 2 buffer because we hold on to the last one */
gst_query_add_allocation_pool (query, pool, size, 2, 0); gst_query_add_allocation_pool (query, pool, size, 2, 0);