[PATCH] plug a blatant leak in gpt_write

Jim Meyering meyering at redhat.com
Thu May 29 18:53:08 UTC 2008


* libparted/labels/gpt.c (gpt_write):
1,536 bytes in 3 blocks are definitely lost in loss record 9 of 11
   at 0x4A0739E: malloc (vg_replace_malloc.c:207)
   by 0x416F1B: ped_malloc (libparted.c:270)
   by 0x44021F: gpt_write (gpt.c:1036)
   by 0x418F9A: ped_disk_commit_to_dev (disk.c:486)
   by 0x418FE0: ped_disk_commit (disk.c:509)
   by 0x40AF7A: do_mklabel (parted.c:622)
   by 0x40A055: command_run (command.c:139)
   by 0x4121A4: non_interactive_mode (ui.c:1540)
   by 0x40EED8: main (parted.c:2499)
---
 libparted/labels/gpt.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libparted/labels/gpt.c b/libparted/labels/gpt.c
index 0d8357b..148eea3 100644
--- a/libparted/labels/gpt.c
+++ b/libparted/labels/gpt.c
@@ -1033,7 +1033,7 @@ gpt_write(const PedDisk * disk)
 	GPTDiskData* gpt_disk_data;
 	GuidPartitionEntry_t* ptes;
 	uint32_t ptes_crc;
-        uint8_t* pth_raw = ped_malloc (pth_get_size (disk->dev));
+        uint8_t* pth_raw;
 	GuidPartitionTableHeader_t* gpt;
 	PedPartition* part;
 	int ptes_size;
-- 
1.5.6.rc0.30.g7c3f3




More information about the parted-devel mailing list