gfile: don't report completion twice on g_file_load_contents error
authorCosimo Cecchi <cosimoc@gnome.org>
Sun, 20 Jan 2013 19:00:50 +0000 (14:00 -0500)
committerCosimo Cecchi <cosimoc@gnome.org>
Mon, 21 Jan 2013 15:36:42 +0000 (10:36 -0500)
commite908b50371a5052d7a9690b3409ae028d46540b4
tree0a9c22c85b96254541ca3e4f13cb85abe39221ab
parent40f8e15c1b07f46d36b16cf8bcf9fce7f1a73c54
gfile: don't report completion twice on g_file_load_contents error

When an error occurs while reading the file input stream in
g_file_load_contents (e.g. because the operation was cancelled), the
code is correctly calling g_task_return_error(), but in the callback
from the close operation, g_task_return_boolean() will be called again.

Code that cleans up its state in the async callback will then be called
twice, leading to invalid memory access.

https://bugzilla.gnome.org/show_bug.cgi?id=692202
gio/gfile.c