From d144bba6f85f6f2440c968b50145be0042e1990e Mon Sep 17 00:00:00 2001 From: Vojtech Trefny Date: Fri, 27 Mar 2026 15:44:36 +0100 Subject: [PATCH 1/2] part: Fix partition reference leak in bd_part_resize_part The fdisk_unref_partition() call was commented out due to a double-free bug in libfdisk (fixed in util-linux 2.35). Add a version-guarded unref to prevent the leak on fixed versions while preserving the workaround for older ones. Co-Authored-By: Claude Opus 4.6 --- src/plugins/part.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/plugins/part.c b/src/plugins/part.c index 7a3533b3..faf8d451 100644 --- a/src/plugins/part.c +++ b/src/plugins/part.c @@ -1712,8 +1712,10 @@ gboolean bd_part_resize_part (const gchar *disk, const gchar *part, guint64 size fdisk_unref_table (table); - /* XXX: double free in libfdisk, see https://github.com/karelzak/util-linux/pull/822 - fdisk_unref_partition (pa); */ + /* fixed in mass fdisk_ref_partition() in libfdisk 2.35, + see https://github.com/karelzak/util-linux/pull/822 */ + if (fdisk_version >= 2350) + fdisk_unref_partition (pa); close_context (cxt); bd_utils_report_finished (progress_id, "Completed"); From f9dab688de1ec7f307b79a257b30b9e6085b68e9 Mon Sep 17 00:00:00 2001 From: Vojtech Trefny Date: Fri, 27 Mar 2026 15:48:40 +0100 Subject: [PATCH 2/2] nvme: Remove dead g_free call on known-NULL pointer The g_free(host_id_val) call is unreachable with a non-NULL value since it's inside a `if (host_id_val == NULL)` block. Co-Authored-By: Claude Opus 4.6 --- src/plugins/nvme/nvme-fabrics.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/plugins/nvme/nvme-fabrics.c b/src/plugins/nvme/nvme-fabrics.c index 918481f6..796b6bfc 100644 --- a/src/plugins/nvme/nvme-fabrics.c +++ b/src/plugins/nvme/nvme-fabrics.c @@ -272,7 +272,6 @@ gboolean bd_nvme_connect (const gchar *subsysnqn, const gchar *transport, const "Could not determine HostID value from HostNQN '%s'", host_nqn_val); g_free (host_nqn_val); - g_free (host_id_val); return FALSE; }