[gtk/ebassi/memdup2: 5/11] x11: Move from g_memdup() to g_memdup2()




commit 71c04bb77907e5ee3d679a7828f1bead99d255aa
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Thu Feb 4 19:15:32 2021 +0000

    x11: Move from g_memdup() to g_memdup2()
    
    The g_memdup() function is replaced by a safer version in newer versions
    of GLib.

 gdk/x11/gdkdevice-xi2.c  | 2 +-
 gdk/x11/gdksurface-x11.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gdk/x11/gdkdevice-xi2.c b/gdk/x11/gdkdevice-xi2.c
index 0102f65c7a..70035c23a0 100644
--- a/gdk/x11/gdkdevice-xi2.c
+++ b/gdk/x11/gdkdevice-xi2.c
@@ -760,7 +760,7 @@ gdk_x11_device_xi2_store_axes (GdkX11DeviceXI2 *device,
   g_free (device->last_axes);
 
   if (axes && n_axes)
-    device->last_axes = g_memdup (axes, sizeof (double) * n_axes);
+    device->last_axes = g_memdup2 (axes, sizeof (double) * n_axes);
   else
     device->last_axes = NULL;
 }
diff --git a/gdk/x11/gdksurface-x11.c b/gdk/x11/gdksurface-x11.c
index feecf917a2..1ab71a7cce 100644
--- a/gdk/x11/gdksurface-x11.c
+++ b/gdk/x11/gdksurface-x11.c
@@ -4232,7 +4232,7 @@ _gdk_x11_moveresize_handle_event (const XEvent *event)
             *mv_resize->moveresize_pending_event = *event;
           else
             mv_resize->moveresize_pending_event =
-              g_memdup (event, sizeof (XEvent));
+              g_memdup2 (event, sizeof (XEvent));
 
           break;
         }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]