gri3-wm/src
Orestis Floros 4143f3abfc
Fix memory leak when _XKB_RULES_NAMES can't be found
Steps to reproduce:

1. Force the branch to be taken:

diff --git a/src/bindings.c b/src/bindings.c
index fe77bc8f..caa5848c 100644
--- a/src/bindings.c
+++ b/src/bindings.c
@@ -941,7 +941,7 @@ bool load_keymap(void) {

     struct xkb_keymap *new_keymap = NULL;
     int32_t device_id;
-    if (xkb_supported && (device_id = xkb_x11_get_core_keyboard_device_id(conn)) > -1) {
+    if (0) {
         if ((new_keymap = xkb_x11_keymap_new_from_device(xkb_context, conn, device_id, 0)) == NULL) {
             ELOG("xkb_x11_keymap_new_from_device failed\n");
             return false;

2. Run `python2 ./xproperty.py _XKB_RULES_NAMES ''` (from
https://github.com/siemer/xproperty) in the xinitrc
3. Memory sanitizers detect memory leaks.

Note: We don't (and didn't) pass NULL in xkb_keymap_new_from_names() but
an xkb_rule_names structures with NULL fields (fill_rmlvo_from_root only
fills its argument when there are no errors) should be equivalent:
767fa86d42/NEWS (L349-L351)
> The function xkb_keymap_new_from_names() now accepts a NULL value for
the 'names' parameter, instead of failing. This is equivalent to passing
a 'struct xkb_rule_names' with all fields set to NULL.

Fixes #2535.
2018-03-29 17:46:41 +03:00
..
assignments.c run_assignments: check for A_COMMAND early 2018-03-19 03:17:32 +02:00
bindings.c Fix memory leak when _XKB_RULES_NAMES can't be found 2018-03-29 17:46:41 +03:00
click.c Merge pull request #2998 from orestisf1993/issue-2990 2018-01-14 18:22:44 +01:00
commands.c Introduce get_existing_workspace_by_num 2018-03-28 15:18:43 +03:00
commands_parser.c Ensure all *.[ch] files include config.h 2016-10-23 21:09:24 +02:00
con.c _con_move_to_con: don't change focus when moving to active workspace 2018-03-28 15:10:11 +03:00
config.c Free A_TO_WORKSPACE_NUMBER assignments 2018-03-25 20:35:53 +03:00
config_directives.c cfg_workspace: memleak on duplicate workspace assignment 2018-03-25 20:27:07 +03:00
config_parser.c migrate_config: scalloc converted config 2017-12-09 20:07:58 +02:00
display_version.c no-op refactoring: make ipc_connect find socket path 2017-11-26 16:41:59 +01:00
ewmh.c Support _NET_WM_STATE_FOCUSED 2018-03-23 14:30:57 +02:00
fake_outputs.c fake_outputs: Allow designating a fake output as primary 2017-09-19 14:57:08 +00:00
floating.c xcb_drag_prepare_cb: drain events (#3193) 2018-03-26 17:59:34 +02:00
handlers.c Refocus focused window for FOCUS_IN events on the root window. (#3097) 2018-03-10 19:18:44 +01:00
ipc.c Add strip_workspace_name 2018-03-11 12:17:42 +08:00
key_press.c Ensure all *.[ch] files include config.h 2016-10-23 21:09:24 +02:00
load_layout.c Introduce get_existing_workspace_by_name 2018-03-28 15:18:43 +03:00
log.c Report error during error log creation (#2625) 2017-01-10 09:29:06 +01:00
main.c Don't raise floating windows when focused because of focus_follows_mouse 2018-01-14 15:45:33 +02:00
manage.c Introduce get_existing_workspace_by_num 2018-03-28 15:18:43 +03:00
match.c Implement 'swap' command. 2017-05-15 21:06:38 +02:00
move.c Improve directional moving of fullscreen containers 2018-03-23 15:46:40 +02:00
output.c _con_move_to_con: don't change focus when moving to active workspace 2018-03-28 15:10:11 +03:00
randr.c Introduce get_existing_workspace_by_name 2018-03-28 15:18:43 +03:00
regex.c Fix memleak: free regex when parsing fails 2017-08-28 09:22:56 +02:00
render.c Replace http:// with https:// where applicable 2017-09-24 10:19:07 +02:00
resize.c Improve resize_find_tiling_participants() and simplify cmd_resize_tiling_width_height() (#3111) 2018-01-06 17:59:27 +01:00
restore_layout.c Move XCB event handling into xcb_prepare_cb. 2017-10-23 21:06:13 +02:00
scratchpad.c Don't raise floating windows when focused because of focus_follows_mouse 2018-01-14 15:45:33 +02:00
sd-daemon.c Always use socket activation 2016-06-11 14:47:23 +02:00
sighandler.c Replace http:// with https:// where applicable 2017-09-24 10:19:07 +02:00
startup.c startup.c: free timer 2018-03-25 20:04:31 +03:00
tree.c Prefer fullscreen floating containers when on directional focus 2018-03-25 14:47:45 +03:00
util.c Fix compilation warnings on all Debian architectures. (#3007) 2017-09-30 10:16:21 -07:00
version.c Ensure all *.[ch] files include config.h 2016-10-23 21:09:24 +02:00
window.c Replace http:// with https:// where applicable 2017-09-24 10:19:07 +02:00
workspace.c Introduce get_existing_workspace_by_num 2018-03-28 15:18:43 +03:00
x.c Support _NET_WM_STATE_FOCUSED 2018-03-23 14:30:57 +02:00
xcb.c add error check and log for xcb_create_window 2017-05-12 09:01:37 +02:00
xcursor.c Ensure all *.[ch] files include config.h 2016-10-23 21:09:24 +02:00
xinerama.c Store output names as a linked list 2017-09-13 08:23:24 +00:00