xkbcomp/ast-build: fix memory leak when appending multi-keysyms
`syms` was not freed. Signed-off-by: Ran Benita <ran234@gmail.com>master
parent
26453b8473
commit
2963e29f0e
|
@ -110,6 +110,9 @@ typedef darray (unsigned long) darray_ulong;
|
|||
#define darray_copy(arr_to, arr_from) \
|
||||
darray_from_items((arr_to), (arr_from).item, (arr_from).size)
|
||||
|
||||
#define darray_concat(arr_to, arr_from) \
|
||||
darray_append_items((arr_to), (arr_from).item, (arr_from).size)
|
||||
|
||||
/*** String buffer ***/
|
||||
|
||||
#define darray_append_string(arr, str) do { \
|
||||
|
|
|
@ -226,14 +226,12 @@ ExprAppendKeysymList(ExprDef *expr, xkb_keysym_t sym)
|
|||
ExprDef *
|
||||
ExprAppendMultiKeysymList(ExprDef *expr, ExprDef *append)
|
||||
{
|
||||
xkb_keysym_t *syms;
|
||||
unsigned nSyms = darray_size(expr->keysym_list.syms);
|
||||
unsigned numEntries = darray_size(append->keysym_list.syms);
|
||||
|
||||
darray_append(expr->keysym_list.symsMapIndex, nSyms);
|
||||
darray_append(expr->keysym_list.symsNumEntries, numEntries);
|
||||
darray_steal(append->keysym_list.syms, &syms, NULL);
|
||||
darray_append_items(expr->keysym_list.syms, syms, numEntries);
|
||||
darray_concat(expr->keysym_list.syms, append->keysym_list.syms);
|
||||
|
||||
FreeStmt((ParseCommon *) &append);
|
||||
|
||||
|
|
Loading…
Reference in New Issue