From 8bfc2998135ee9c4460520febb3af720c61438a5 Mon Sep 17 00:00:00 2001 From: Michael Catanzaro Date: Thu, 1 Apr 2021 14:13:19 -0500 Subject: [PATCH] gfileenumerator: fix leak in error path Found by Coverity. --- gio/gfileenumerator.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gio/gfileenumerator.c b/gio/gfileenumerator.c index ac2e4eb98..1f9bc24eb 100644 --- a/gio/gfileenumerator.c +++ b/gio/gfileenumerator.c @@ -787,7 +787,10 @@ next_files_thread (GTask *task, } if (error) - g_task_return_error (task, error); + { + g_list_free_full (files, g_object_unref); + g_task_return_error (task, error); + } else g_task_return_pointer (task, files, (GDestroyNotify)next_async_op_free); }