fix a memory leak in mainwindow about keys

This commit is contained in:
Florian Stinglmayr 2019-07-20 13:49:28 +02:00
parent 6eff70d415
commit 08b69263d6

View File

@ -400,7 +400,7 @@ void ncdc_mainwindow_input_ready(ncdc_mainwindow_t n)
if (key != NULL && if (key != NULL &&
(k = ncdc_find_keybinding(keys_global, key, keylen)) != NULL) { (k = ncdc_find_keybinding(keys_global, key, keylen)) != NULL) {
k->handler(n); k->handler(n);
return; goto cleanup;
} }
switch (n->focus) { switch (n->focus) {
@ -434,6 +434,8 @@ void ncdc_mainwindow_input_ready(ncdc_mainwindow_t n)
} break; } break;
} }
cleanup:
free(key); free(key);
} }