x11: Move from g_memdup() to g_memdup2()

The g_memdup() function is replaced by a safer version in newer versions
of GLib.
This commit is contained in:
Emmanuele Bassi 2021-02-04 19:15:32 +00:00
parent 3a3e029270
commit cf3f742ad8
2 changed files with 4 additions and 2 deletions

View File

@ -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;
}

View File

@ -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;
}