summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVojtech Trefny2019-07-19 13:35:11 +0200
committerVojtech Trefny2019-07-19 13:42:49 +0200
commit79f37ec4e1ab65664a2930793f497b288563e907 (patch)
treea09c091bab586bcae970a367aea2732920cbee53
parentlibfdisk: don't use NTFS as MBR (diff)
downloadkernel-qcow2-util-linux-79f37ec4e1ab65664a2930793f497b288563e907.tar.gz
kernel-qcow2-util-linux-79f37ec4e1ab65664a2930793f497b288563e907.tar.xz
kernel-qcow2-util-linux-79f37ec4e1ab65664a2930793f497b288563e907.zip
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 <vtrefny@redhat.com>
-rw-r--r--libfdisk/src/partition.c4
1 files changed, 4 insertions, 0 deletions
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;
}