Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Persch <chpe@src.gnome.org>2009-02-15 13:51:36 (GMT)
committer Christian Persch <chpe@src.gnome.org>2009-02-15 13:51:36 (GMT)
commit47a708110ac25d902940d67d30f4eb14e8b427bb (patch)
tree2f579524f247ffe73ccae4ff0a76bc10f95912e1
parentf870dd6bcd19cbbe8f62a4c2b04c1c5bd440bd8b (diff)
Don't leak the input stream.
* libdocument/ev-file-helpers.c: (get_mime_type_from_data): Don't leak the input stream. svn path=/trunk/; revision=3439
-rw-r--r--ChangeLog5
-rw-r--r--libdocument/ev-file-helpers.c3
2 files changed, 8 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 6d46566..22f2cd5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2009-02-13 Christian Persch <chpe@gnome.org>
+ * libdocument/ev-file-helpers.c: (get_mime_type_from_data): Don't leak
+ the input stream.
+
+2009-02-13 Christian Persch <chpe@gnome.org>
+
* libdocument/ev-file-helpers.c: (get_mime_type_from_data): Propagate
all errors upwards.
diff --git a/libdocument/ev-file-helpers.c b/libdocument/ev-file-helpers.c
index 8d51301..8811f25 100644
--- a/libdocument/ev-file-helpers.c
+++ b/libdocument/ev-file-helpers.c
@@ -252,11 +252,14 @@ get_mime_type_from_data (const gchar *uri, GError **error)
size_read = g_input_stream_read (G_INPUT_STREAM (input_stream),
buffer, sizeof (buffer), NULL, error);
if (size_read == -1) {
+ g_object_unref (input_stream);
g_object_unref (file);
return NULL;
}
retval = g_input_stream_close (G_INPUT_STREAM (input_stream), NULL, error);
+
+ g_object_unref (input_stream);
g_object_unref (file);
if (!retval)
return NULL;