Commit b1be543b authored by Matthias Clasen's avatar Matthias Clasen
Browse files

Use free() to free XIButtonState.mask

XIQueryPointer() allocates it using malloc() (without any mention
in the documentation...).
parent 10b6afa1
......@@ -26,6 +26,7 @@
#include "gdkasync.h"
#include "gdkprivate-x11.h"
#include <stdlib.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/extensions/XInput2.h>
......@@ -362,7 +363,7 @@ gdk_x11_device_xi2_query_state (GdkDevice *device,
if (mask)
*mask = _gdk_x11_device_xi2_translate_state (&mod_state, &button_state);
g_free (button_state.mask);
free (button_state.mask);
return TRUE;
}
......@@ -531,7 +532,7 @@ gdk_x11_device_xi2_window_at_position (GdkDevice *device,
XSetWindowAttributes attributes;
Window w;
g_free (button_state.mask);
free (button_state.mask);
w = XCreateWindow (xdisplay, xwindow, (int)xwin_x, (int)xwin_y, 1, 1, 0,
CopyFromParent, InputOnly, CopyFromParent,
......@@ -566,7 +567,7 @@ gdk_x11_device_xi2_window_at_position (GdkDevice *device,
while (xwindow)
{
last = xwindow;
g_free (button_state.mask);
free (button_state.mask);
gdk_x11_display_error_trap_push (display);
XIQueryPointer (xdisplay,
......@@ -603,7 +604,7 @@ gdk_x11_device_xi2_window_at_position (GdkDevice *device,
if (mask)
*mask = _gdk_x11_device_xi2_translate_state (&mod_state, &button_state);
g_free (button_state.mask);
free (button_state.mask);
return window;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment