From: Christian Persch Date: Sun, 15 Feb 2009 13:51:36 +0000 (+0000) Subject: Don't leak the input stream. X-Git-Tag: EVINCE_2_25_91~41 X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=commitdiff_plain;h=47a708110ac25d902940d67d30f4eb14e8b427bb;p=evince.git 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 --- diff --git a/ChangeLog b/ChangeLog index 6d465661..22f2cd5f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-02-13 Christian Persch + + * libdocument/ev-file-helpers.c: (get_mime_type_from_data): Don't leak + the input stream. + 2009-02-13 Christian Persch * libdocument/ev-file-helpers.c: (get_mime_type_from_data): Propagate diff --git a/libdocument/ev-file-helpers.c b/libdocument/ev-file-helpers.c index 8d51301c..8811f25c 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;