]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
cfdisk: fix memory leak of original_layout table
authorKarel Zak <kzak@redhat.com>
Tue, 28 Apr 2026 12:51:14 +0000 (14:51 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 28 Apr 2026 12:51:14 +0000 (14:51 +0200)
The original_layout table, allocated via fdisk_get_partitions() to
track the on-disk partition layout, was never freed on exit. Add the
missing fdisk_unref_table() call.

Signed-off-by: Karel Zak <kzak@redhat.com>
disk-utils/cfdisk.c

index 692efb1e838d9d0942369529f8bce32a5b47fdbc..13cbadf1b055cc690ca5e9245e4fa83771728d6c 100644 (file)
@@ -2854,6 +2854,7 @@ int main(int argc, char *argv[])
        free(cf->fields);
 
        fdisk_unref_table(cf->table);
+       fdisk_unref_table(cf->original_layout);
 #ifdef HAVE_LIBMOUNT
        mnt_unref_table(cf->fstab);
        mnt_unref_table(cf->mtab);