mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-10-04 20:59:21 +02:00
do not leak the output stream.
* gfile.c (g_file_replace_contents): do not leak the output stream. svn path=/branches/glib-2-16/; revision=7118
This commit is contained in:
@@ -1,3 +1,9 @@
|
||||
2008-06-30 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
Backported from trunk:
|
||||
|
||||
* gfile.c (g_file_replace_contents): do not leak the output stream.
|
||||
|
||||
2008-06-30 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
Backported from trunk:
|
||||
|
@@ -5399,6 +5399,7 @@ g_file_replace_contents (GFile *file,
|
||||
{
|
||||
/* Ignore errors on close */
|
||||
g_output_stream_close (G_OUTPUT_STREAM (out), cancellable, NULL);
|
||||
g_object_unref (out);
|
||||
|
||||
/* error is set already */
|
||||
return FALSE;
|
||||
@@ -5410,6 +5411,8 @@ g_file_replace_contents (GFile *file,
|
||||
if (new_etag)
|
||||
*new_etag = g_file_output_stream_get_etag (out);
|
||||
|
||||
g_object_unref (out);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user