diff options
author | Ran Benita <ran234@gmail.com> | 2014-05-28 20:32:16 +0300 |
---|---|---|
committer | Ran Benita <ran234@gmail.com> | 2014-05-28 20:36:58 +0300 |
commit | d6f2d8ecd07984a2c8725090acb806a16b51738a (patch) | |
tree | 3498223842a4e074c50ff0b14ed7d078ff7b7789 | |
parent | 76e1fca20a8acead90af5ee40d802f531a26fdda (diff) | |
download | libxkbcommon-d6f2d8ecd07984a2c8725090acb806a16b51738a.tar.gz libxkbcommon-d6f2d8ecd07984a2c8725090acb806a16b51738a.tar.bz2 libxkbcommon-d6f2d8ecd07984a2c8725090acb806a16b51738a.zip |
rules: fix leak on failure
matcher_match() builds up the kccgst's, and we steal the memory on
success. But on error we didn't free it.
Signed-off-by: Ran Benita <ran234@gmail.com>
-rw-r--r-- | src/xkbcomp/rules.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/xkbcomp/rules.c b/src/xkbcomp/rules.c index 61799e7..39125da 100644 --- a/src/xkbcomp/rules.c +++ b/src/xkbcomp/rules.c @@ -309,6 +309,8 @@ matcher_free(struct matcher *m) darray_free(m->rmlvo.options); darray_foreach(group, m->groups) darray_free(group->elements); + for (int i = 0; i < _KCCGST_NUM_ENTRIES; i++) + darray_free(m->kccgst[i]); darray_free(m->groups); free(m); } @@ -950,6 +952,8 @@ finish: /* out->geometry = darray_mem(m->kccgst[KCCGST_GEOMETRY], 0); */ darray_free(m->kccgst[KCCGST_GEOMETRY]); out->symbols = darray_mem(m->kccgst[KCCGST_SYMBOLS], 0); + for (int i = 0; i < _KCCGST_NUM_ENTRIES; i++) + darray_init(m->kccgst[i]); return true; |