From 6a0a77e2fa708b50823f4de27facb05d9d888dd2 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Mon, 3 Aug 2009 19:11:14 +0000 Subject: [PATCH] Patch by Bryce Groff with small change by myself: * Don't leak the driver settings handle. * No need to get the "active" parameter in ValidateCreateChild() -- either way is fine. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32098 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/add-ons/disk_systems/intel/PartitionMapAddOn.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/add-ons/disk_systems/intel/PartitionMapAddOn.cpp b/src/add-ons/disk_systems/intel/PartitionMapAddOn.cpp index 86edd76907..9eda8017db 100644 --- a/src/add-ons/disk_systems/intel/PartitionMapAddOn.cpp +++ b/src/add-ons/disk_systems/intel/PartitionMapAddOn.cpp @@ -349,8 +349,8 @@ PartitionMapHandle::ValidateCreateChild(off_t* _offset, off_t* _size, void* handle = parse_driver_settings_string(parameters); if (handle == NULL) return B_ERROR; - - bool active = get_driver_boolean_parameter(handle, "active", false, true); + get_driver_boolean_parameter(handle, "active", false, true); + delete_driver_settings(handle); // do we have a spare primary partition? if (fPartitionMap.CountNonEmptyPrimaryPartitions() == 4) @@ -467,6 +467,7 @@ PartitionMapHandle::CreateChild(off_t offset, off_t size, return B_ERROR; bool active = get_driver_boolean_parameter(handle, "active", false, true); + delete_driver_settings(handle); // get a spare primary partition PrimaryPartition* primary = NULL; @@ -507,8 +508,6 @@ PartitionMapHandle::CreateChild(off_t offset, off_t size, if (!foundSpace) return B_BAD_VALUE; - // everything looks good, do it - // create the child // (Note: the primary partition index is indeed the child index, since // we picked the first empty primary partition.) @@ -529,9 +528,6 @@ PartitionMapHandle::CreateChild(off_t offset, off_t size, // init the primary partition primary->SetTo(offset, size, type.Type(), active, partition->BlockSize()); - // TODO: If the child is an extended partition, we should trigger its - // initialization. - *_child = child; return B_OK; }