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

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