[PATCH] plug a leak in gpt_read

Jim Meyering meyering at redhat.com
Thu May 29 18:38:13 UTC 2008


* libparted/labels/gpt.c (gpt_read):
7,195 bytes in 13 blocks are definitely lost...
   at 0x4A0739E: malloc (vg_replace_malloc.c:207)
   by 0x416F1B: ped_malloc (libparted.c:270)
   by 0x43E759: pth_new (gpt.c:287)
   by 0x43E83C: pth_new_from_raw (gpt.c:310)
   by 0x43F329: _read_header (gpt.c:627)
   by 0x43FB31: gpt_read (gpt.c:826)
   by 0x41882B: ped_disk_new (disk.c:210)
   by 0x40B773: do_mkpartfs (parted.c:884)
   by 0x40A055: command_run (command.c:139)
---
 libparted/labels/gpt.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/libparted/labels/gpt.c b/libparted/labels/gpt.c
index 8bb9554..5be0235 100644
--- a/libparted/labels/gpt.c
+++ b/libparted/labels/gpt.c
@@ -924,6 +924,7 @@ gpt_read (PedDisk * disk)
 		ped_disk_commit_to_dev (disk);
 #endif

+        pth_free (gpt);
 	return 1;

 error_delete_all:
-- 
1.5.6.rc0.30.g7c3f3




More information about the parted-devel mailing list