[gtk/ebassi/memdup2: 4/10] x11: Move from g_memdup() to g_memdup2()
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/ebassi/memdup2: 4/10] x11: Move from g_memdup() to g_memdup2()
- Date: Thu, 11 Feb 2021 13:55:41 +0000 (UTC)
commit 4500f75e3bb354bdd7a41c4b0412b1b6b3acd820
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 | 4 +++-
gdk/x11/gdksurface-x11.c | 2 +-
2 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/gdk/x11/gdkdevice-xi2.c b/gdk/x11/gdkdevice-xi2.c
index 0102f65c7a..d59dc37612 100644
--- a/gdk/x11/gdkdevice-xi2.c
+++ b/gdk/x11/gdkdevice-xi2.c
@@ -26,6 +26,8 @@
#include "gdkprivate-x11.h"
#include "gdkdisplay-x11.h"
+#include "gdk-private.h"
+
#include <stdlib.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
@@ -760,7 +762,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]