From cbe57a487bad858471a2f6ed43b2186bd8b0a77a Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Mon, 15 Apr 2013 00:40:19 +0200 Subject: [PATCH] * grub-core/kern/ieee1275/openfw.c (grub_ieee1275_devalias_next): Make source and destination differ. --- ChangeLog | 5 +++++ grub-core/kern/ieee1275/openfw.c | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index b37266844..74690301f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2013-04-15 Vladimir Serbinenko + + * grub-core/kern/ieee1275/openfw.c (grub_ieee1275_devalias_next): Make + source and destination differ. + 2013-04-15 Vladimir Serbinenko * grub-core/disk/ieee1275/ofdisk.c: Fix CD-ROM and boot device diff --git a/grub-core/kern/ieee1275/openfw.c b/grub-core/kern/ieee1275/openfw.c index 90c092c72..07c90f7cb 100644 --- a/grub-core/kern/ieee1275/openfw.c +++ b/grub-core/kern/ieee1275/openfw.c @@ -193,18 +193,22 @@ grub_ieee1275_devalias_next (struct grub_ieee1275_devalias *alias) { grub_ssize_t pathlen; grub_ssize_t actual; + char *tmp; if (alias->path) { grub_free (alias->path); alias->path = 0; } - if (grub_ieee1275_next_property (alias->parent_dev, alias->name, + tmp = grub_strdup (alias->name); + if (grub_ieee1275_next_property (alias->parent_dev, tmp, alias->name) <= 0) { + grub_free (tmp); grub_ieee1275_devalias_free (alias); return 0; } + grub_free (tmp); grub_dprintf ("devalias", "devalias name = %s\n", alias->name);