Commit 07964a30 authored by Olivier Crête's avatar Olivier Crête

outputstream: Fix reference leak

parent 9c57b011
...@@ -533,13 +533,16 @@ nice_output_stream_write_nonblocking (GPollableOutputStream *stream, ...@@ -533,13 +533,16 @@ nice_output_stream_write_nonblocking (GPollableOutputStream *stream,
return -1; return -1;
} }
if (count == 0) if (count == 0) {
g_object_unref (agent);
return 0; return 0;
}
/* This is equivalent to the default GPollableOutputStream implementation. */ /* This is equivalent to the default GPollableOutputStream implementation. */
if (!g_pollable_output_stream_is_writable (stream)) { if (!g_pollable_output_stream_is_writable (stream)) {
g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_WOULD_BLOCK, g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_WOULD_BLOCK,
g_strerror (EAGAIN)); g_strerror (EAGAIN));
g_object_unref (agent);
return -1; return -1;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment