]> git.ipfire.org Git - thirdparty/util-linux.git/commit
libsmartcols: fix memory leak in filter reset
authorKarel Zak <kzak@redhat.com>
Tue, 23 Jun 2026 09:07:30 +0000 (11:07 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 24 Jun 2026 09:20:15 +0000 (11:20 +0200)
commit27e262dee792363fd8395bcf427463d47e634f25
treeac7a6726b2e93db6b1b42469cba363c3719e0161
parent2857d9ce932730fa2d5dd3c1aeedf73cf38bdb06
libsmartcols: fix memory leak in filter reset

When parsing fails, filter params allocated during parsing but never
incorporated into the AST tree remain on the fltr->params list. The
reset_filter() only freed the tree via fltr->root, leaving orphaned
params leaked.

Add filter_free_params() to drain any remaining params from the list
during filter reset.

Addresses: https://github.com/util-linux/util-linux/pull/4430
Signed-off-by: Karel Zak <kzak@redhat.com>
libsmartcols/src/filter-param.c
libsmartcols/src/filter.c
libsmartcols/src/smartcolsP.h