Got questions, comments, patches, etc.?
Contact Jason Woofenden
gitweb
/
spectrwm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
we need to free what is returned from xcb_key_symbols_get_keycode
[spectrwm.git]
/
spectrwm.c
diff --git
a/spectrwm.c
b/spectrwm.c
index
c674051
..
3d7e10e
100644
(file)
--- a/
spectrwm.c
+++ b/
spectrwm.c
@@
-820,7
+820,9
@@
teardown_ewmh(void)
pc = xcb_get_property(conn, 0, screens[i].root, sup_check,
XCB_ATOM_WINDOW, 0, 1);
pr = xcb_get_property_reply(conn, pc, NULL);
pc = xcb_get_property(conn, 0, screens[i].root, sup_check,
XCB_ATOM_WINDOW, 0, 1);
pr = xcb_get_property_reply(conn, pc, NULL);
- if (pr && pr->format == sup_check) {
+ if (!pr)
+ continue;
+ if (pr->format == sup_check) {
id = *((xcb_window_t *)xcb_get_property_value(pr));
xcb_destroy_window(conn, id);
id = *((xcb_window_t *)xcb_get_property_value(pr));
xcb_destroy_window(conn, id);
@@
-2199,6
+2201,8
@@
fake_keypress(struct ws_win *win, xcb_keysym_t keysym, uint16_t modifiers)
event.response_type = XCB_KEY_RELEASE;
xcb_send_event(conn, 1, win->id,
XCB_EVENT_MASK_KEY_RELEASE, (const char *)&event);
event.response_type = XCB_KEY_RELEASE;
xcb_send_event(conn, 1, win->id,
XCB_EVENT_MASK_KEY_RELEASE, (const char *)&event);
+
+ free(keycode);
}
void
}
void
@@
-2299,8
+2303,10
@@
find_window(xcb_window_t id)
return (NULL);
/* if we were looking for the parent return that window instead */
return (NULL);
/* if we were looking for the parent return that window instead */
- if (r->parent == 0 || r->root == r->parent)
+ if (r->parent == 0 || r->root == r->parent) {
+ free(r);
return (NULL);
return (NULL);
+ }
/* look for parent */
for (i = 0; i < num_screens; i++)
/* look for parent */
for (i = 0; i < num_screens; i++)
@@
-5506,7
+5512,7
@@
updatenumlockmask(void)
{
unsigned int i, j;
xcb_get_modifier_mapping_reply_t *modmap_r;
{
unsigned int i, j;
xcb_get_modifier_mapping_reply_t *modmap_r;
- xcb_keycode_t *modmap, kc;
+ xcb_keycode_t *modmap, kc, *keycode;
DNPRINTF(SWM_D_MISC, "updatenumlockmask\n");
numlockmask = 0;
DNPRINTF(SWM_D_MISC, "updatenumlockmask\n");
numlockmask = 0;
@@
-5520,10
+5526,11
@@
updatenumlockmask(void)
for (j = 0; j < modmap_r->keycodes_per_modifier; j++) {
kc = modmap[i * modmap_r->keycodes_per_modifier
+ j];
for (j = 0; j < modmap_r->keycodes_per_modifier; j++) {
kc = modmap[i * modmap_r->keycodes_per_modifier
+ j];
-
- if (kc == *((xcb_keycode_t *)xcb_key_symbols_get_keycode(syms,
- XK_Num_Lock)))
+ keycode = xcb_key_symbols_get_keycode(syms,
+ XK_Num_Lock);
+ if (kc == *keycode)
numlockmask = (1 << i);
numlockmask = (1 << i);
+ free(keycode);
}
}
free(modmap_r);
}
}
free(modmap_r);
@@
-5558,6
+5565,7
@@
grabkeys(void)
kp->mod | modifiers[j],
*code, XCB_GRAB_MODE_ASYNC,
XCB_GRAB_MODE_ASYNC);
kp->mod | modifiers[j],
*code, XCB_GRAB_MODE_ASYNC,
XCB_GRAB_MODE_ASYNC);
+ free(code);
}
}
}
}
}
}
@@
-6420,7
+6428,9
@@
get_ws_idx(xcb_window_t id)
xcb_get_property(conn, 0, id, a_swm_ws,
XCB_ATOM_STRING, 0, SWM_PROPLEN),
NULL);
xcb_get_property(conn, 0, id, a_swm_ws,
XCB_ATOM_STRING, 0, SWM_PROPLEN),
NULL);
- if (gpr && gpr->type) {
+ if (!gpr)
+ return (-1);
+ if (gpr->type) {
proplen = xcb_get_property_value_length(gpr);
if (proplen > 0) {
prop = malloc(proplen + 1);
proplen = xcb_get_property_value_length(gpr);
if (proplen > 0) {
prop = malloc(proplen + 1);