[Parted-commits] GNU Parted Official Repository: Changes to 'stable-1.8.x'

Otavio Salvador otavio at alioth.debian.org
Tue Apr 29 17:48:33 UTC 2008


 parted/parted.c |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

New commits:
commit 529c01ca3a40d07a7417a9ffcb47b512e4658359
Author: Matt Davis <mattdavis9 at gmail.com>
Date:   Mon Apr 28 22:56:59 2008 -0400

    Corrected a few memory leaks from unallocated ped_unit_format calls.
    
    Deallocated memory in do_print() allocated by ped_unit_format calls.
    (cherry picked from commit eadcd8e418af50c7ae6eaa5a7c5d19bc26ff1efa)

diff --git a/parted/parted.c b/parted/parted.c
index f135e8b..d27a8e6 100644
--- a/parted/parted.c
+++ b/parted/parted.c
@@ -1490,6 +1490,9 @@ do_print (PedDevice** dev)
                     table_add_row_from_strlist (table, row);
                     str_list_destroy (row);
                     ped_free (tmp);
+                    ped_free (start);
+                    ped_free (end);
+                    ped_free (size);
             }
 
             table_rendered = table_render (table); 

commit fbc975ba97d99b11bf81794a2a19e2f38068166c
Author: Matt Davis <mattdavis9 at gmail.com>
Date:   Mon Apr 28 22:28:49 2008 -0400

    Corrected memory leak when displaying partition flags.
    
    Deallocated memory allocated by partition_print_flags()
    (cherry picked from commit fcbf070239dc590db6a2aaf9d9e3608d2ff45204)

diff --git a/parted/parted.c b/parted/parted.c
index 94d07e5..f135e8b 100644
--- a/parted/parted.c
+++ b/parted/parted.c
@@ -1274,6 +1274,7 @@ do_print (PedDevice** dev)
         char*           size;
         const char*     name;
         char*           tmp;
+        char*           flags;
         wchar_t*        table_rendered;
 
         disk = ped_disk_new (*dev);
@@ -1473,7 +1474,9 @@ do_print (PedDevice** dev)
                                     str_list_append (row, name);
                             }
 
-                            str_list_append (row, partition_print_flags (part));
+                            flags = partition_print_flags (part);
+                            str_list_append (row, flags);
+                            ped_free (flags);
                     } else {
                             if (has_extended)
                                     str_list_append (row, "");



More information about the Parted-commits mailing list