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