]> git.pld-linux.org Git - packages/parted.git/blame - 0095-parted.c-Always-free-peek_word.patch
- release 6 (by relup.sh)
[packages/parted.git] / 0095-parted.c-Always-free-peek_word.patch
CommitLineData
74a816df
MK
1From b260c3354d5e9318321c2fc482724870fd9b2740 Mon Sep 17 00:00:00 2001
2From: "Brian C. Lane" <bcl@redhat.com>
3Date: Mon, 23 Jul 2018 15:12:38 -0700
4Subject: [PATCH 095/103] parted.c: Always free peek_word
5
6If command_line_get_fs_type failed it would never free it, so put a free
7in both branches of the if.
8
9Related: rhbz#1602652
10---
11 parted/parted.c | 3 ++-
12 1 file changed, 2 insertions(+), 1 deletion(-)
13
14diff --git a/parted/parted.c b/parted/parted.c
15index 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--
342.17.2
35
This page took 0.904585 seconds and 4 git commands to generate.