gsize *bytes_written,
GError **error)
{
- GExpanderConverter *conv;
const guint8 *in, *in_end;
guint8 v, *out;
int i;
gsize block_size;
- conv = G_EXPANDER_CONVERTER (converter);
-
in = inbuf;
out = outbuf;
in_end = in + inbuf_size;
gsize *bytes_written,
GError **error)
{
- GCompressorConverter *conv;
const guint8 *in, *in_end;
guint8 v, *out;
int i;
gsize block_size;
- conv = G_COMPRESSOR_CONVERTER (converter);
-
in = inbuf;
out = outbuf;
in_end = in + inbuf_size;
istream0 = g_memory_input_stream_new_from_data (data0,
DATA_LENGTH * sizeof (guint32), NULL);
- ostream1 = g_memory_output_stream_new (NULL, 0, g_realloc, NULL);
+ ostream1 = g_memory_output_stream_new (NULL, 0, g_realloc, g_free);
compressor = G_CONVERTER (g_zlib_compressor_new (format, level));
costream1 = g_converter_output_stream_new (ostream1, compressor);
g_assert (g_converter_output_stream_get_converter (G_CONVERTER_OUTPUT_STREAM (costream1)) == compressor);
g_assert_cmpint (fmt, ==, format);
g_assert_cmpint (lvl, ==, level);
g_object_unref (compressor);
- data1 = g_memory_output_stream_get_data (G_MEMORY_OUTPUT_STREAM (ostream1));
+ data1 = g_memory_output_stream_steal_data (G_MEMORY_OUTPUT_STREAM (ostream1));
data1_size = g_memory_output_stream_get_data_size (
G_MEMORY_OUTPUT_STREAM (ostream1));
g_object_unref (ostream1);
g_object_unref (istream0);
- istream1 = g_memory_input_stream_new_from_data (data1, data1_size, NULL);
+ istream1 = g_memory_input_stream_new_from_data (data1, data1_size, g_free);
decompressor = G_CONVERTER (g_zlib_decompressor_new (format));
cistream1 = g_converter_input_stream_new (istream1, decompressor);
- ostream2 = g_memory_output_stream_new (NULL, 0, g_realloc, NULL);
+ ostream2 = g_memory_output_stream_new (NULL, 0, g_realloc, g_free);
g_output_stream_splice (ostream2, cistream1, 0, NULL, &error);
g_assert_no_error (error);
g_object_unref (decompressor);
g_object_unref (cistream1);
g_object_unref (ostream2);
+ g_free (data0);
}
typedef struct {
g_object_unref (in);
if (test->n_fallbacks == 0)
- return;
+ {
+ g_object_unref (conv);
+ return;
+ }
g_converter_reset (conv);