summaryrefslogtreecommitdiff
path: root/parted
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2009-10-28 16:40:07 +0100
committerJim Meyering <meyering@redhat.com>2009-10-28 16:40:07 +0100
commit399f89cb70a257323a14b17bde9ee868a6fd8075 (patch)
treebe4cecaa39929bb0f7791ea7cce4530de70bc124 /parted
parent0bbeb3d1f2973076152f25d63f0335f51dc4e883 (diff)
downloadparted-399f89cb70a257323a14b17bde9ee868a6fd8075.tar.gz
ui: plug multiple command_line_get_word leaks
* parted/parted.c (do_mkpart, do_print):
Diffstat (limited to 'parted')
-rw-r--r--parted/parted.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/parted/parted.c b/parted/parted.c
index 79e50ad..17e94ef 100644
--- a/parted/parted.c
+++ b/parted/parted.c
@@ -836,6 +836,7 @@ do_mkpart (PedDevice** dev)
/* set minor attributes */
if (part_name)
PED_ASSERT (ped_partition_set_name (part, part_name), return 0);
+ free (part_name);
if (!ped_partition_set_system (part, fs_type))
goto error_destroy_disk;
if (ped_partition_is_flag_available (part, PED_PARTITION_LBA))
@@ -867,6 +868,7 @@ error_remove_part:
error_destroy_simple_constraints:
ped_partition_destroy (part);
error_destroy_disk:
+ free (part_name);
ped_disk_destroy (disk);
error:
if (range_start != NULL)
@@ -1311,16 +1313,19 @@ do_print (PedDevice** dev)
peek_word = command_line_peek_word ();
if (peek_word) {
if (strncmp (peek_word, "devices", 7) == 0) {
- command_line_pop_word();
+ char *w = command_line_pop_word();
+ free (w);
has_devices_arg = 1;
}
else if (strncmp (peek_word, "free", 4) == 0) {
- command_line_pop_word ();
+ char *w = command_line_pop_word ();
+ free (w);
has_free_arg = 1;
}
else if (strncmp (peek_word, "list", 4) == 0 ||
strncmp (peek_word, "all", 3) == 0) {
- command_line_pop_word();
+ char *w = command_line_pop_word();
+ free (w);
has_list_arg = 1;
}
else