gbufferedoutputstream: Fix jump conditional on uninitialised data

The flush data structures were not zero-initialised, which meant the
branch in flush_buffer_thread() was based on an uninitialised condition.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
This commit is contained in:
Philip Withnall 2018-06-27 09:51:12 +01:00
parent cbfa776fc1
commit c1d8b9c806

View File

@ -699,7 +699,7 @@ g_buffered_output_stream_flush_async (GOutputStream *stream,
GTask *task;
FlushData *fdata;
fdata = g_slice_new (FlushData);
fdata = g_slice_new0 (FlushData);
fdata->flush_stream = TRUE;
fdata->close_stream = FALSE;
@ -732,7 +732,7 @@ g_buffered_output_stream_close_async (GOutputStream *stream,
GTask *task;
FlushData *fdata;
fdata = g_slice_new (FlushData);
fdata = g_slice_new0 (FlushData);
fdata->close_stream = TRUE;
task = g_task_new (stream, cancellable, callback, data);