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:
Matthias Clasen
2008-07-01 02:37:29 +00:00
parent 8af6c328a9
commit e34b0b5c72
2 changed files with 9 additions and 0 deletions

View File

@@ -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> 2008-06-30 Matthias Clasen <mclasen@redhat.com>
Backported from trunk: Backported from trunk:

View File

@@ -5399,6 +5399,7 @@ g_file_replace_contents (GFile *file,
{ {
/* Ignore errors on close */ /* Ignore errors on close */
g_output_stream_close (G_OUTPUT_STREAM (out), cancellable, NULL); g_output_stream_close (G_OUTPUT_STREAM (out), cancellable, NULL);
g_object_unref (out);
/* error is set already */ /* error is set already */
return FALSE; return FALSE;
@@ -5410,6 +5411,8 @@ g_file_replace_contents (GFile *file,
if (new_etag) if (new_etag)
*new_etag = g_file_output_stream_get_etag (out); *new_etag = g_file_output_stream_get_etag (out);
g_object_unref (out);
return TRUE; return TRUE;
} }