*****************************************************************************/
/*
- * Copyright (C) 2000 - 2004, R. Byron Moore
+ * Copyright (C) 2000 - 2005, R. Byron Moore
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
break;
default:
- /*
- * Whatever other type -- it is not supported
- */
+ /* All other types are not supported */
+
return_ACPI_STATUS (AE_SUPPORT);
}
- switch (external_object->type) {
-
/* Must COPY string and buffer contents */
+ switch (external_object->type) {
case ACPI_TYPE_STRING:
internal_object->string.pointer =
ACPI_MEM_CALLOCATE ((acpi_size) external_object->string.length + 1);
if (!internal_object->string.pointer) {
- return_ACPI_STATUS (AE_NO_MEMORY);
+ goto error_exit;
}
ACPI_MEMCPY (internal_object->string.pointer,
internal_object->buffer.pointer =
ACPI_MEM_CALLOCATE (external_object->buffer.length);
if (!internal_object->buffer.pointer) {
- return_ACPI_STATUS (AE_NO_MEMORY);
+ goto error_exit;
}
ACPI_MEMCPY (internal_object->buffer.pointer,
*ret_internal_object = internal_object;
return_ACPI_STATUS (AE_OK);
+
+
+error_exit:
+ acpi_ut_remove_reference (internal_object);
+ return_ACPI_STATUS (AE_NO_MEMORY);
}
status = acpi_ut_copy_simple_object (source_object, target_object);
if (ACPI_FAILURE (status)) {
- return (status);
+ goto error_exit;
}
*this_target_ptr = target_object;
ACPI_MEM_CALLOCATE (((acpi_size) source_object->package.count + 1) *
sizeof (void *));
if (!target_object->package.elements) {
- ACPI_MEM_FREE (target_object);
- return (AE_NO_MEMORY);
+ status = AE_NO_MEMORY;
+ goto error_exit;
}
/*
}
return (status);
+
+error_exit:
+ acpi_ut_remove_reference (target_object);
+ return (status);
}