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

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