mirror of
https://github.com/leahneukirchen/cwm.git
synced 2023-08-10 21:13:12 +03:00
plug a leak when using 'unmap' for kbd/mouse bindings; from Tiago Cunha.
This commit is contained in:
parent
76b0874b4c
commit
bd25218333
8
conf.c
8
conf.c
@ -483,8 +483,10 @@ conf_bindname(struct conf *c, char *name, char *binding)
|
|||||||
/* We now have the correct binding, remove duplicates. */
|
/* We now have the correct binding, remove duplicates. */
|
||||||
conf_unbind(c, current_binding);
|
conf_unbind(c, current_binding);
|
||||||
|
|
||||||
if (strcmp("unmap", binding) == 0)
|
if (strcmp("unmap", binding) == 0) {
|
||||||
|
free(current_binding);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
for (iter = 0; iter < nitems(name_to_kbfunc); iter++) {
|
for (iter = 0; iter < nitems(name_to_kbfunc); iter++) {
|
||||||
if (strcmp(name_to_kbfunc[iter].tag, binding) != 0)
|
if (strcmp(name_to_kbfunc[iter].tag, binding) != 0)
|
||||||
@ -574,8 +576,10 @@ conf_mousebind(struct conf *c, char *name, char *binding)
|
|||||||
|
|
||||||
conf_mouseunbind(c, current_binding);
|
conf_mouseunbind(c, current_binding);
|
||||||
|
|
||||||
if (strcmp("unmap", binding) == 0)
|
if (strcmp("unmap", binding) == 0) {
|
||||||
|
free(current_binding);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
for (iter = 0; iter < nitems(name_to_mousefunc); iter++) {
|
for (iter = 0; iter < nitems(name_to_mousefunc); iter++) {
|
||||||
if (strcmp(name_to_mousefunc[iter].tag, binding) != 0)
|
if (strcmp(name_to_mousefunc[iter].tag, binding) != 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user