diff options
author | okan <okan> | 2012-11-07 20:37:55 +0000 |
---|---|---|
committer | okan <okan> | 2012-11-07 20:37:55 +0000 |
commit | bd252183338229977adc77849a857b597908f71c (patch) | |
tree | 14265001108d3632476bc2253d702a491a2c92a5 | |
parent | 76b0874b4caa937b5313b3604208d050b4868b04 (diff) | |
download | cwm-bd252183338229977adc77849a857b597908f71c.tar.gz cwm-bd252183338229977adc77849a857b597908f71c.tar.xz cwm-bd252183338229977adc77849a857b597908f71c.zip |
plug a leak when using 'unmap' for kbd/mouse bindings; from Tiago Cunha.
-rw-r--r-- | conf.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/conf.c b/conf.c index 9e40fa2..df3566a 100644 --- a/conf.c +++ b/conf.c @@ -483,8 +483,10 @@ conf_bindname(struct conf *c, char *name, char *binding) /* We now have the correct binding, remove duplicates. */ conf_unbind(c, current_binding); - if (strcmp("unmap", binding) == 0) + if (strcmp("unmap", binding) == 0) { + free(current_binding); return; + } for (iter = 0; iter < nitems(name_to_kbfunc); iter++) { 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); - if (strcmp("unmap", binding) == 0) + if (strcmp("unmap", binding) == 0) { + free(current_binding); return; + } for (iter = 0; iter < nitems(name_to_mousefunc); iter++) { if (strcmp(name_to_mousefunc[iter].tag, binding) != 0) |