summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <matthiasc@src.gnome.org>2008-07-01 02:37:29 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2008-07-01 02:37:29 +0000
commite34b0b5c7276f7a3ef82a54d8cf7f68431c84137 (patch)
treee46438d1a595c7213fb06b918e742ecc13714135
parent8af6c328a96c3e06dc862863d6862504326196cf (diff)
downloadglib-e34b0b5c7276f7a3ef82a54d8cf7f68431c84137.tar.gz
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
-rw-r--r--gio/ChangeLog6
-rw-r--r--gio/gfile.c3
2 files changed, 9 insertions, 0 deletions
diff --git a/gio/ChangeLog b/gio/ChangeLog
index 355ecbced..d1b07239f 100644
--- a/gio/ChangeLog
+++ b/gio/ChangeLog
@@ -2,6 +2,12 @@
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:
+
Bug 530196 – _g_local_file_has_trash_dir() doesn't handle st_dev == 0
* glocalfile.c (_g_local_file_has_trash_dir): Handle the case that
diff --git a/gio/gfile.c b/gio/gfile.c
index 60b44af34..a240688d9 100644
--- a/gio/gfile.c
+++ b/gio/gfile.c
@@ -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;
}