gtkselectioninputstream-x11: Do not add unreffed bytes to the chunks queue
authorMarco Trevisan (Treviño) <mail@3v1n0.net>
Tue, 30 May 2023 15:43:57 +0000 (17:43 +0200)
committerMarco Trevisan (Treviño) <mail@3v1n0.net>
Tue, 30 May 2023 15:43:57 +0000 (17:43 +0200)
This should never happen, but we may exit the loop because of count value
with an unreffed bytes pointer being added back to the chunks queue.

gdk/x11/gdkselectioninputstream-x11.c

index 7ea92ef368855bd5adc26f1f15e99e2edfc4bf2c..0f4ce37d4c3c03452fc4d9d5baf760f828e7b256 100644 (file)
@@ -107,7 +107,7 @@ gdk_x11_selection_input_stream_fill_buffer (GdkX11SelectionInputStream *stream,
           memcpy (buffer, g_bytes_get_data (bytes, NULL), size);
       }
 
-    g_bytes_unref (bytes);
+    g_bytes_unref (g_steal_pointer (&bytes));
     result += size;
     if (buffer)
       buffer += size;