OSDN Git Service

plug a blatant leak in gpt_write
authorJim Meyering <meyering@redhat.com>
Thu, 29 May 2008 18:53:08 +0000 (20:53 +0200)
committerJim Meyering <meyering@redhat.com>
Sat, 31 May 2008 14:42:41 +0000 (16:42 +0200)
* 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

index 2d2c82c..3343c3a 100644 (file)
@@ -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;