1 From 059c9548534bef5b0312ac7089eb60e8596469be Mon Sep 17 00:00:00 2001
2 From: Amarnath Valluri <amarnath.valluri@intel.com>
3 Date: Fri, 31 Jul 2015 12:12:44 +0300
4 Subject: [PATCH 15/18] UI: Avoid memory leaks.
6 * parted/ui.c(command_line_get_sector): Don't leak input string.
7 * parted/ui.c(command_line_prompt_words): Don't leak _def string in
10 Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
11 Signed-off-by: Brian C. Lane <bcl@redhat.com>
12 (cherry picked from commit 50dc0862a94a3e6e77d4cfb2af21de117fbb4819)
14 parted/ui.c | 6 +++++-
15 1 file changed, 5 insertions(+), 1 deletion(-)
17 diff --git a/parted/ui.c b/parted/ui.c
18 index 7365e7d..505b8ac 100644
21 @@ -829,8 +829,11 @@ command_line_prompt_words (const char* prompt, const char* def,
24 if (opt_script_mode) {
27 command_line_push_line (_def, 0);
28 + if (_def_needs_free)
34 @@ -938,6 +941,7 @@ command_line_get_sector (const char* prompt, PedDevice* dev, PedSector* value,
36 *range = ped_geometry_new (dev, *value, 1);
39 return *range != NULL;