OSDN Git Service

plug a leak in ped_device_get_constraint
authorJim Meyering <meyering@redhat.com>
Thu, 29 May 2008 13:47:21 +0000 (15:47 +0200)
committerJim Meyering <meyering@redhat.com>
Thu, 29 May 2008 20:35:22 +0000 (22:35 +0200)
* libparted/device.c (ped_device_get_constraint):
512 (224 direct, 288 indirect) bytes in 6 blocks are definitely lost...
  malloc (vg_replace_malloc.c:207)
  ped_malloc (libparted.c:270)
  ped_alignment_new (natmath.c:153)
  ped_device_get_constraint (device.c:432)
  do_mkpartfs (parted.c:927)
  command_run (command.c:139)
  non_interactive_mode (ui.c:1540)
  main (parted.c:2497)

libparted/device.c

index ac2a5cd..6595572 100644 (file)
@@ -1,6 +1,6 @@
 /*
     libparted - a library for manipulating disk partitions
-    Copyright (C) 1999 - 2001, 2005, 2007 Free Software Foundation, Inc.
+    Copyright (C) 1999 - 2001, 2005, 2007-2008 Free Software Foundation, Inc.
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -437,6 +437,7 @@ ped_device_get_constraint (PedDevice* dev)
                                 ped_geometry_new (dev, 0, dev->length),
                                 1, dev->length);
 
+        free (start_align);
         return c;
 }