[PATCH] dvh: document an as-yet-unplugged (but not serious) leak

Jim Meyering meyering at redhat.com
Thu Oct 29 11:22:25 UTC 2009


* libparted/disk.c (ped_disk_add_partition): List some of the
things I've tried to plug a leak exposed by a root-only test
on dvh's partition-creation error path.  This leak is enough
of a corner case that I may even leave it for now, and add a
suppression for it, so that we're not distracted by it.
---
 libparted/disk.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/libparted/disk.c b/libparted/disk.c
index beb0921..3a02537 100644
--- a/libparted/disk.c
+++ b/libparted/disk.c
@@ -1813,6 +1813,12 @@ ped_disk_add_partition (PedDisk* disk, PedPartition* part,
 		if (!_partition_align (part, constraints))
 			goto error;
 	}
+        /* FIXME: when _check_partition fails, we end up leaking PART
+           at least for DVH partition tables.  Simply calling
+           ped_partition_destroy(part) here fixes it for DVH, but
+           causes trouble for other partition types.  Similarly,
+           reordering these two checks, putting _check_partition after
+           _disk_raw_add induces an infinite loop.  */
 	if (!_check_partition (disk, part))
 		goto error;
 	if (!_disk_raw_add (disk, part))
--
1.6.5.2.375.g164f1



More information about the parted-devel mailing list