Blame SOURCES/0085-parted.c-Always-free-peek_word.patch

003ee8
From d42cea08828c72c6f289add05acd3b93d481fbee Mon Sep 17 00:00:00 2001
003ee8
From: "Brian C. Lane" <bcl@redhat.com>
003ee8
Date: Mon, 23 Jul 2018 15:12:38 -0700
003ee8
Subject: [PATCH 85/86] parted.c: Always free peek_word
003ee8
003ee8
If command_line_get_fs_type failed it would never free it, so put a free
003ee8
in both branches of the if.
003ee8
003ee8
Related: rhbz#1602652
003ee8
---
003ee8
 parted/parted.c | 3 ++-
003ee8
 1 file changed, 2 insertions(+), 1 deletion(-)
003ee8
003ee8
diff --git a/parted/parted.c b/parted/parted.c
003ee8
index b49e1df..dae35a5 100644
003ee8
--- a/parted/parted.c
003ee8
+++ b/parted/parted.c
003ee8
@@ -684,12 +684,13 @@ do_mkpart (PedDevice** dev, PedDisk** diskp)
003ee8
         if (part_type == PED_PARTITION_EXTENDED
003ee8
             || (peek_word && isdigit (peek_word[0]))) {
003ee8
                 fs_type = NULL;
003ee8
+                free (peek_word);
003ee8
         } else {
003ee8
+                free (peek_word);
003ee8
                 if (!command_line_get_fs_type (_("File system type?"),
003ee8
                                                &fs_type))
003ee8
                         goto error;
003ee8
         }
003ee8
-        free (peek_word);
003ee8
 
003ee8
         if (!command_line_get_sector (_("Start?"), *dev, &start, &range_start, NULL))
003ee8
                 goto error;
003ee8
-- 
003ee8
2.17.1
003ee8