]> git.ipfire.org Git - thirdparty/grub.git/commit
gnulib/regcomp: Fix resource leak
authorAlec Brown <alec.r.brown@oracle.com>
Tue, 10 Jun 2025 15:19:44 +0000 (15:19 +0000)
committerDaniel Kiper <daniel.kiper@oracle.com>
Tue, 17 Jun 2025 12:17:56 +0000 (14:17 +0200)
commitbba7dd7363402157034e9c94ee3d9ea82e37861d
treec1473a33bf4198ada6783ff5dba0a76e8502fb17
parent91cb7ff6bb05089af573775298148d88fbc1771b
gnulib/regcomp: Fix resource leak

In the functions create_initial_state() and calc_eclosure_iter(), memory
is allocated for the elems member of a re_node_set structure but that
memory isn't freed on error. Before returning an error, a call to
re_node_set_free() should be made to prevent the resource leak.

This issue has been fixed in the latest version of gnulib and I've
backported this change to maintain consistency.

This issue was found by a Coverity scan of GRUB2 under the following
CIDs: 473869, 473888.

Fixes: CID 473869
Fixes: CID 473888
Signed-off-by: Alec Brown <alec.r.brown@oracle.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
bootstrap.conf
conf/Makefile.extra-dist
grub-core/lib/gnulib-patches/fix-regcomp-resource-leak.patch [new file with mode: 0644]