>From e2be2688b2f8f40b8f8067333e347c2d21ae2430 Mon Sep 17 00:00:00 2001
From: Matt Davis <[EMAIL PROTECTED]>
Date: Wed, 30 Apr 2008 23:50:17 -0400
Subject: [PATCH] Patched a mem leak that might arise when using the print
command.
Deallocated memory allocated for returning a word from the command line.
---
parted/parted.c | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/parted/parted.c b/parted/parted.c
index 0f6768b..cccc4da 100644
--- a/parted/parted.c
+++ b/parted/parted.c
@@ -1294,17 +1294,20 @@ do_print (PedDevice** dev)
peek_word = command_line_peek_word ();
if (peek_word) {
if (strncmp (peek_word, "devices", 7) == 0) {
- command_line_pop_word();
+ tmp = command_line_pop_word();
has_devices_arg = 1;
+ ped_free (tmp);
}
else if (strncmp (peek_word, "free", 4) == 0) {
- command_line_pop_word ();
+ tmp = command_line_pop_word ();
has_free_arg = 1;
+ ped_free (tmp);
}
else if (strncmp (peek_word, "list", 4) == 0 ||
strncmp (peek_word, "all", 3) == 0) {
- command_line_pop_word();
+ tmp = command_line_pop_word();
has_list_arg = 1;
+ ped_free (tmp);
}
else
has_num_arg = isdigit(peek_word[0]);
--
1.5.1.5
_______________________________________________
parted-devel mailing list
[email protected]
http://lists.alioth.debian.org/mailman/listinfo/parted-devel