summaryrefslogtreecommitdiff
path: root/parted
diff options
context:
space:
mode:
authorBrian C. Lane <bcl@redhat.com>2018-07-23 15:12:38 -0700
committerBrian C. Lane <bcl@redhat.com>2018-08-22 11:37:56 -0700
commitb260c3354d5e9318321c2fc482724870fd9b2740 (patch)
treef32b9408972eeecc00d6b42176a1bc2e9c5feebd /parted
parent60906f5674ca32ddfaf8c18fe2e4ebe510dbbd6f (diff)
downloadparted-b260c3354d5e9318321c2fc482724870fd9b2740.tar.gz
parted.c: Always free peek_word
If command_line_get_fs_type failed it would never free it, so put a free in both branches of the if. Related: rhbz#1602652
Diffstat (limited to 'parted')
-rw-r--r--parted/parted.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/parted/parted.c b/parted/parted.c
index 267c346..0dc38c3 100644
--- a/parted/parted.c
+++ b/parted/parted.c
@@ -684,12 +684,13 @@ do_mkpart (PedDevice** dev, PedDisk** diskp)
if (part_type == PED_PARTITION_EXTENDED
|| (peek_word && (isdigit (peek_word[0]) || peek_word[0] == '-'))) {
fs_type = NULL;
+ free (peek_word);
} else {
+ free (peek_word);
if (!command_line_get_fs_type (_("File system type?"),
&fs_type))
goto error;
}
- free (peek_word);
if (!command_line_get_sector (_("Start?"), *dev, &start, &range_start, NULL))
goto error;