* disk/fs_uuid.c (grub_fs_uuid_open): Allocate memory to copy
parent's partition, don't copy it by reference, as it gets freed
on close.
+2009-04-28 Pavel Roskin <proski@gnu.org>
+
+ * disk/fs_uuid.c (grub_fs_uuid_open): Allocate memory to copy
+ parent's partition, don't copy it by reference, as it gets freed
+ on close.
+
2009-04-27 Vladimir Serbinenko <phcoder@gmail.com>
Preboot hooks support
#include <grub/types.h>
#include <grub/fs.h>
+#include <grub/partition.h>
static grub_device_t
search_fs_uuid (const char *key, unsigned long *count)
disk->total_sectors = dev->disk->total_sectors;
disk->has_partitions = 0;
- disk->partition = dev->disk->partition;
+ if (dev->disk->partition)
+ {
+ disk->partition = grub_malloc (sizeof (*disk->partition));
+ if (disk->partition)
+ grub_memcpy (disk->partition, dev->disk->partition,
+ sizeof (*disk->partition));
+ }
+ else
+ disk->partition = NULL;
+
disk->data = dev->disk;
return GRUB_ERR_NONE;