Properly free xkb_state's Signed-off-by: Ran Benita <ran234@gmail.com>
diff --git a/src/state.c b/src/state.c
index ea5b390..52b2301 100644
--- a/src/state.c
+++ b/src/state.c
@@ -444,10 +444,11 @@ xkb_state_unref(struct xkb_state *state)
{
state->refcnt--;
assert(state->refcnt >= 0);
- if (state->refcnt == 0)
+ if (state->refcnt > 0)
return;
xkb_map_unref(state->xkb);
+ free(state->filters);
free(state);
}