From 0985e70488cede2e856381fd2185d8aaf305b72d Mon Sep 17 00:00:00 2001
From: vmlobanov78 <vmlobanov78@gmail.com>
Date: Tue, 18 Sep 2018 10:34:23 +0000
Subject: [PATCH 239/682] glib-compile-resources: Fix size allocation for
 compressed streams
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The length of the stolen data from a memory output stream is given by
get_data_size() — get_size() can be larger, and hence cause unnecessary
overallocation.
---
 gio/glib-compile-resources.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gio/glib-compile-resources.c b/gio/glib-compile-resources.c
index 6ce5aec4a..7e318b254 100644
--- a/gio/glib-compile-resources.c
+++ b/gio/glib-compile-resources.c
@@ -483,7 +483,7 @@ end_element (GMarkupParseContext  *context,
 	    }
 
 	  g_free (data->content);
-	  data->content_size = g_memory_output_stream_get_size (G_MEMORY_OUTPUT_STREAM (out));
+	  data->content_size = g_memory_output_stream_get_data_size (G_MEMORY_OUTPUT_STREAM (out));
 	  data->content = g_memory_output_stream_steal_data (G_MEMORY_OUTPUT_STREAM (out));
 
 	  g_object_unref (compressor);
-- 
2.19.1

