GdkWin32: Zero-out memory of an allocated struct
authorLuca Bacci <luca.bacci982@gmail.com>
Tue, 21 Mar 2023 09:34:32 +0000 (10:34 +0100)
committerLuca Bacci <luca.bacci982@gmail.com>
Tue, 21 Mar 2023 09:50:09 +0000 (10:50 +0100)
Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/5678

gdk/win32/gdkselection-win32.c

index caa1a86a6de5a2f7984d4fc212a5960e70c8ea96..04c7280f3ad5594d56e4b53060135f2d4f92aaaf 100644 (file)
@@ -1968,10 +1968,10 @@ queue_open_clipboard (GdkWin32ClipboardQueueAction  action,
        return;
     }
 
-  info = g_slice_new (GdkWin32ClipboardQueueInfo);
+  info = g_slice_new0 (GdkWin32ClipboardQueueInfo);
 
   info->display = display;
-  g_set_object (&info->requestor, requestor);
+  info->requestor = g_object_ref (requestor);
   info->selection = GDK_SELECTION_CLIPBOARD;
   info->target = target;
   info->idle_time = 0;