]>
Commit | Line | Data |
---|---|---|
74a816df MK |
1 | From b260c3354d5e9318321c2fc482724870fd9b2740 Mon Sep 17 00:00:00 2001 |
2 | From: "Brian C. Lane" <bcl@redhat.com> | |
3 | Date: Mon, 23 Jul 2018 15:12:38 -0700 | |
4 | Subject: [PATCH 095/103] parted.c: Always free peek_word | |
5 | ||
6 | If command_line_get_fs_type failed it would never free it, so put a free | |
7 | in both branches of the if. | |
8 | ||
9 | Related: rhbz#1602652 | |
10 | --- | |
11 | parted/parted.c | 3 ++- | |
12 | 1 file changed, 2 insertions(+), 1 deletion(-) | |
13 | ||
14 | diff --git a/parted/parted.c b/parted/parted.c | |
15 | index 267c346..0dc38c3 100644 | |
16 | --- a/parted/parted.c | |
17 | +++ b/parted/parted.c | |
18 | @@ -684,12 +684,13 @@ do_mkpart (PedDevice** dev, PedDisk** diskp) | |
19 | if (part_type == PED_PARTITION_EXTENDED | |
20 | || (peek_word && (isdigit (peek_word[0]) || peek_word[0] == '-'))) { | |
21 | fs_type = NULL; | |
22 | + free (peek_word); | |
23 | } else { | |
24 | + free (peek_word); | |
25 | if (!command_line_get_fs_type (_("File system type?"), | |
26 | &fs_type)) | |
27 | goto error; | |
28 | } | |
29 | - free (peek_word); | |
30 | ||
31 | if (!command_line_get_sector (_("Start?"), *dev, &start, &range_start, NULL)) | |
32 | goto error; | |
33 | -- | |
34 | 2.17.2 | |
35 |