[PATCH 1/5] libparted: remove unreachable code

Jim Meyering meyering at redhat.com
Fri Jan 15 18:18:48 UTC 2010


* libparted/labels/gpt.c (gpt_write): Remove dead code.
* libparted/labels/bsd.c (bsd_partition_new): Likewise.
* libparted/disk.c (_ped_disk_alloc): Likewise.
---
 libparted/disk.c       |    1 -
 libparted/labels/bsd.c |    1 -
 libparted/labels/gpt.c |    1 -
 3 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/libparted/disk.c b/libparted/disk.c
index 2d27b7c..b819d59 100644
--- a/libparted/disk.c
+++ b/libparted/disk.c
@@ -406,7 +406,6 @@ _ped_disk_alloc (const PedDevice* dev, const PedDiskType* disk_type)
 	disk->part_list = NULL;
 	return disk;

-	free (disk);
 error:
 	return NULL;
 }
diff --git a/libparted/labels/bsd.c b/libparted/labels/bsd.c
index df531e9..e1b57e5 100644
--- a/libparted/labels/bsd.c
+++ b/libparted/labels/bsd.c
@@ -416,7 +416,6 @@ bsd_partition_new (const PedDisk* disk, PedPartitionType part_type,
 	}
 	return part;

-	free (bsd_data);
 error_free_part:
 	free (part);
 error:
diff --git a/libparted/labels/gpt.c b/libparted/labels/gpt.c
index 4ae7b59..fe1f300 100644
--- a/libparted/labels/gpt.c
+++ b/libparted/labels/gpt.c
@@ -1240,7 +1240,6 @@ gpt_write (const PedDisk *disk)
   free (ptes);
   return ped_device_sync (disk->dev);

-  free (pth_raw);
 error_free_ptes:
   free (ptes);
 error:
--
1.6.6.556.gd6679




More information about the parted-devel mailing list