Here are two more patches for some memory leaks, 0005 patches a leak that occurs
of blocksize. I hope these memory deallocation patches are not getting
annoying. Just felt like doing some contributing to parted.
-Matt
>From 56d1a74b2c41d7c42d2fa59f870a826ee2a517e4 Mon Sep 17 00:00:00 2001
From: Matt Davis <[EMAIL PROTECTED]>
Date: Thu, 1 May 2008 23:53:06 -0400
Subject: [PATCH] Plug a small mem hole.
Deallocate an allocated alignment struct that is not needed.
---
libparted/device.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/libparted/device.c b/libparted/device.c
index e4bbb02..ff7831d 100644
--- a/libparted/device.c
+++ b/libparted/device.c
@@ -437,6 +437,8 @@ ped_device_get_constraint (PedDevice* dev)
ped_geometry_new (dev, 0, dev->length),
1, dev->length);
+ ped_alignment_destroy (start_align);
+
return c;
}
--
1.5.1.5
>From f983e0fdc8eb38845ce60f16ac136f412f1ba057 Mon Sep 17 00:00:00 2001
From: Matt Davis <[EMAIL PROTECTED]>
Date: Fri, 2 May 2008 00:03:53 -0400
Subject: [PATCH] Free metadata superblock after ext2 metadata has been commited.
Deallocate memory allocated after it has been used to store sb data. This
occurs when writing ext2 metadata to disk.
---
libparted/fs/ext2/ext2.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/libparted/fs/ext2/ext2.c b/libparted/fs/ext2/ext2.c
index 79fc6f6..121cf9c 100644
--- a/libparted/fs/ext2/ext2.c
+++ b/libparted/fs/ext2/ext2.c
@@ -657,6 +657,8 @@ int ext2_commit_metadata(struct ext2_fs *fs, int copies)
/* Clear the flags of the components we just finished writing. */
fs->metadirty &= ~copies;
+ ped_free (sb);
+
return 1;
}
--
1.5.1.5
_______________________________________________
parted-devel mailing list
[email protected]
http://lists.alioth.debian.org/mailman/listinfo/parted-devel