From 5775738f67eb8d670dd535216459b81f36d196ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Dzi=C4=99giel?= Date: Sat, 7 May 2022 13:43:51 +0200 Subject: [PATCH] plugin: Fix possible dir enumerator NULL unref On an unlikely chance that sink was compiled without any importers, iterated dir does not exists thus we try to unref a NULL. Avoid doing that. --- lib/gst/plugin/gstclapperimporterloader.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/gst/plugin/gstclapperimporterloader.c b/lib/gst/plugin/gstclapperimporterloader.c index c9eb99a8..9dc07b26 100644 --- a/lib/gst/plugin/gstclapperimporterloader.c +++ b/lib/gst/plugin/gstclapperimporterloader.c @@ -212,10 +212,11 @@ _obtain_available_importers (G_GNUC_UNUSED gpointer data) GST_INFO ("Found importer: %s, caps: %" GST_PTR_FORMAT, module_name, data->caps); g_ptr_array_add (importers, data); } + + g_object_unref (dir_enum); } g_object_unref (dir); - g_object_unref (dir_enum); if (error) { GST_ERROR ("Could not load importer, reason: %s",