diff options
author | Colin Walters <walters@verbum.org> | 2016-12-02 13:45:04 -0500 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2016-12-05 15:20:56 +0000 |
commit | e1c48c8adbd14f8767d44d46b1a7a5f896ab1129 (patch) | |
tree | 736082a328e2e9eec0227c1765ce29b0d860b14d /tests/test-lzma.c | |
parent | 7bb0ff46a438977297329ad6949faa4fae06f543 (diff) | |
download | ostree-e1c48c8adbd14f8767d44d46b1a7a5f896ab1129.tar.gz |
[ASAN] tests: Cleanup all current remaining leaks
We now run fully through ASAN here.
Closes: #609
Approved by: jlebon
Diffstat (limited to 'tests/test-lzma.c')
-rw-r--r-- | tests/test-lzma.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/test-lzma.c b/tests/test-lzma.c index 8d37d47f..1f7d2559 100644 --- a/tests/test-lzma.c +++ b/tests/test-lzma.c @@ -32,7 +32,7 @@ static void helper_test_compress_decompress (const guint8 *data, gssize data_size) { - GError *error = NULL; + g_autoptr(GError) error = NULL; g_autoptr(GOutputStream) out_compress = g_memory_output_stream_new_resizable (); g_autoptr(GOutputStream) out_decompress = NULL; g_autoptr(GInputStream) in_compress = g_memory_input_stream_new_from_data (data, data_size, NULL); @@ -55,9 +55,10 @@ helper_test_compress_decompress (const guint8 *data, gssize data_size) { gssize n_bytes_written; g_autoptr(GInputStream) convin = NULL; - g_autoptr(GConverter) decompressor = (GConverter*)_ostree_lzma_decompressor_new (); + g_autoptr(GConverter) decompressor = (GConverter*)_ostree_lzma_decompressor_new (); + g_autoptr(GBytes) bytes = g_memory_output_stream_steal_as_bytes (G_MEMORY_OUTPUT_STREAM (out_compress)); - in_decompress = g_memory_input_stream_new_from_bytes (g_memory_output_stream_steal_as_bytes (G_MEMORY_OUTPUT_STREAM (out_compress))); + in_decompress = g_memory_input_stream_new_from_bytes (bytes); convin = g_converter_input_stream_new ((GInputStream*) in_decompress, decompressor); n_bytes_written = g_output_stream_splice (out_decompress, convin, G_OUTPUT_STREAM_SPLICE_CLOSE_TARGET | G_OUTPUT_STREAM_SPLICE_CLOSE_SOURCE, |