From 79f37ec4e1ab65664a2930793f497b288563e907 Mon Sep 17 00:00:00 2001 From: Vojtech Trefny Date: Fri, 19 Jul 2019 13:35:11 +0200 Subject: libfdisk: Fix double free of *_chs strings in fdisk_partition __copy_partition doesn't duplicate these strings which leads to occasional double free. Signed-off-by: Vojtech Trefny --- libfdisk/src/partition.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libfdisk/src/partition.c b/libfdisk/src/partition.c index 05474a041..55ce1ca5c 100644 --- a/libfdisk/src/partition.c +++ b/libfdisk/src/partition.c @@ -100,6 +100,10 @@ static struct fdisk_partition *__copy_partition(struct fdisk_partition *o) n->fsuuid = strdup(o->fsuuid); if (o->fslabel) n->fslabel = strdup(o->fslabel); + if (o->start_chs) + n->start_chs = strdup(o->start_chs); + if (o->end_chs) + n->end_chs = strdup(o->end_chs); return n; } -- cgit v1.2.3-55-g7522