summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Catanzaro <mcatanzaro@gnome.org>2021-04-01 14:13:19 -0500
committerMichael Catanzaro <mcatanzaro@gnome.org>2021-04-01 14:28:10 -0500
commit8bfc2998135ee9c4460520febb3af720c61438a5 (patch)
tree3fb49a040e6d73b7c335a43bbe3feb60395e4f9b
parent719484a5754cca036d123ae4c2ae3d150bacef32 (diff)
downloadglib-mcatanzaro/coverity.tar.gz
gfileenumerator: fix leak in error pathmcatanzaro/coverity
Found by Coverity.
-rw-r--r--gio/gfileenumerator.c5
1 files changed, 4 insertions, 1 deletions
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);
}