Skip to content
Myr

key-binding: fix crash in debug builds, if exiting early

Before adoption: this commit came in with the history the project adopted, so no landing records it.

If fuzzel exits early, for example because the lock file cannot be acquired (another fuzzel instance is already running), then the kb_manager hasn't been initialized and is thus NULL. This triggered a crash in kb_manager_destroy() in debug builds.

authored by Daniel Eklöf · committed by Daniel Eklöf · parent 1c28aa5 · Browse files · 1 file+1 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+1 added−1 removed

  • other:+1 added−1 removed

1 file+1 added−1 removed

modified:key-binding.c+1 added-1 removed
33 unmodified lines
3435void36kb_manager_destroy(struct kb_manager *mgr)37{38 assert(tll_length(mgr->binding_sets) == 0);38 assert(mgr == NULL || tll_length(mgr->binding_sets) == 0);39 free(mgr);40}4142void
334 unmodified lines