]> git.ipfire.org Git - thirdparty/util-linux.git/commit
libfdisk: fix memory leak in read_pte() error path master
authorKarel Zak <kzak@redhat.com>
Wed, 17 Jun 2026 09:18:18 +0000 (11:18 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 17 Jun 2026 09:18:18 +0000 (11:18 +0200)
commitc86a60b6a7f9ed33c2826692df17c0f15da6d273
treee98acc1a908cad7599c2380b03969df7a421534c
parent77e33a20ec56907fc69452893cd3953d56968b48
libfdisk: fix memory leak in read_pte() error path

Don't assign the sector buffer to the partition table entry until
read_sector() succeeds. On failure, free the buffer immediately
instead of leaving it in a partially initialized pte.

Addresses: https://github.com/util-linux/util-linux/pull/4423
Signed-off-by: Karel Zak <kzak@redhat.com>
libfdisk/src/dos.c