From: Vojtech Trefny Date: Fri, 19 Jul 2019 11:35:11 +0000 (+0200) Subject: libfdisk: Fix double free of *_chs strings in fdisk_partition X-Git-Tag: v2.35-rc1~306^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=79f37ec4e1ab65664a2930793f497b288563e907;p=thirdparty%2Futil-linux.git 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 --- diff --git a/libfdisk/src/partition.c b/libfdisk/src/partition.c index 05474a041c..55ce1ca5cc 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; }