From c7f2a7e431eb48b64fc544b04cbd0dd61eb07f4f Mon Sep 17 00:00:00 2001 From: Ondrej Holy Date: Fri, 11 Aug 2017 13:37:29 +0200 Subject: [PATCH] gio-tool-save: Prevent overwriting error The following warning is shown, when both g_output_stream_write and g_output_stream_close fail: "GError set over the top of a previous GError or uninitialized memory." Let's clear the error after use. https://bugzilla.gnome.org/show_bug.cgi?id=786463 --- gio/gio-tool-save.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gio/gio-tool-save.c b/gio/gio-tool-save.c index 370299cb0..e6b131ffb 100644 --- a/gio/gio-tool-save.c +++ b/gio/gio-tool-save.c @@ -110,7 +110,7 @@ save (GFile *file) { save_res = FALSE; print_error ("%s", error->message); - g_error_free (error); + g_clear_error (error); goto out; } res -= written;