diff options
author | okan | 2012-11-07 20:37:55 +0000 |
---|---|---|
committer | okan | 2012-11-07 20:37:55 +0000 |
commit | 4fa23f6f1162d9f4b48afb7905628a17e22322c1 (patch) | |
tree | 4c597cecf820efba36613f7fbb4c85bc4d28aae2 | |
parent | b43ba68cd49c5275d9a817901bc52e5ab9e1fa0f (diff) | |
download | cwm-4fa23f6f1162d9f4b48afb7905628a17e22322c1.tar.gz |
plug a leak when using 'unmap' for kbd/mouse bindings; from Tiago Cunha.
Diffstat (limited to '')
-rw-r--r-- | conf.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: conf.c,v 1.103 2012/11/07 20:34:39 okan Exp $ + * $OpenBSD: conf.c,v 1.104 2012/11/07 20:37:55 okan Exp $ */ #include <sys/param.h> @@ -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) |